Skip to content

Commit 5e6b8e8

Browse files
authored
Issue #ED-000 merge : Merge pull request #3495 from Sunbird-Ed/release-5.1.0.10
Issue #ED-000 merge : Merged release-5.1.0.10 to release-5.2.0.1
2 parents d4b4c7a + 1f418ae commit 5e6b8e8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

build_config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ cordova-plugin=cordova-plugin-appavailability
2525
cordova-plugin=cordova-plugin-filepicker
2626
cordova-plugin=cordova-plugin-document-viewer
2727
cordova-plugin=com-sarriaroman-photoviewer
28-
cordova-plugin=cordova-plugin-filepath
28+
cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-filepath.git
2929
cordova-plugin=https://github.com/greybax/cordova-plugin-proguard.git
3030
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-utility.git#release-4.1.0
3131
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-downloadmanager.git
3232
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-db.git#release-4.6.0
3333
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-customtabs#release-5.0.2 --variable URL_SCHEME=@string/custom_scheme_url --variable URL_HOST=mobile
3434
cordova-plugin=cordova-sqlite-storage
3535
cordova plugin=cordova-plugin-googleplus
36-
cordova-pligin=cordova-plugin-camera
36+
cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-camera.git
3737
cordova-plugin=cordova-plugin-telerik-imagepicker@2.3.3
3838
cordova-plugin=cordova-plugin-filechooser
3939
cordova-plugin=cordova-plugin-media

src/app/manage-learn/core/services/attachment/attachment.service.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export class AttachmentService {
7979
{
8080
text: this.texts["FRMELEMNTS_MSG_USE_FILE"],
8181
handler: () => {
82-
console.log(path,"oath");
8382
path ? this.openLocalLibrary() : this.openFile();
8483
return false;
8584
},
@@ -115,7 +114,7 @@ export class AttachmentService {
115114
text: this.texts["FRMELEMENTS_LBL_UPLOAD_IMAGE"],
116115
icon: "cloud-upload",
117116
handler: () => {
118-
this.openLocalLibrary()
117+
this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY, this.camera.MediaType.PICTURE);
119118
return false;
120119
},
121120
},
@@ -160,7 +159,7 @@ export class AttachmentService {
160159
.then((imagePath) => {
161160
if (this.platform.is("android") && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY) {
162161
let newFilePath = imagePath;
163-
if (!newFilePath.includes("file://")) {
162+
if (!newFilePath.includes("content://") && !newFilePath.includes("file://")) {
164163
newFilePath = "file://" + imagePath
165164
}
166165
this.checkForFileSizeRestriction(newFilePath).then(isValidFile => {
@@ -221,7 +220,8 @@ export class AttachmentService {
221220

222221
checkForFileSizeRestriction(filePath): Promise<Boolean> {
223222
return new Promise((resolve, reject) => {
224-
this.file.resolveLocalFilesystemUrl(filePath).then(success => {
223+
this.filePath.resolveNativePath(filePath).then(fileData =>{
224+
this.file.resolveLocalFilesystemUrl(fileData).then(success => {
225225
success.getMetadata((metadata) => {
226226
if (metadata.size > localStorageConstants.FILE_LIMIT) {
227227
this.presentToast(this.texts["FRMELEMNTS_LBL_FILE_SIZE_EXCEEDED"],'danger', 5000);
@@ -233,6 +233,9 @@ export class AttachmentService {
233233
}).catch(error => {
234234
reject(false)
235235
})
236+
}).catch(error => {
237+
reject(false)
238+
})
236239
})
237240
}
238241

0 commit comments

Comments
 (0)