Skip to content

Commit

Permalink
Issue #ED-000 merge : Merge pull request #3495 from Sunbird-Ed/releas…
Browse files Browse the repository at this point in the history
…e-5.1.0.10

Issue #ED-000 merge : Merged release-5.1.0.10 to release-5.2.0.1
  • Loading branch information
swayangjit authored Sep 21, 2023
2 parents d4b4c7a + 1f418ae commit 5e6b8e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build_config
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ cordova-plugin=cordova-plugin-appavailability
cordova-plugin=cordova-plugin-filepicker
cordova-plugin=cordova-plugin-document-viewer
cordova-plugin=com-sarriaroman-photoviewer
cordova-plugin=cordova-plugin-filepath
cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-filepath.git
cordova-plugin=https://github.com/greybax/cordova-plugin-proguard.git
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-utility.git#release-4.1.0
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-downloadmanager.git
cordova-plugin=https://github.com/Sunbird-Ed/sb-cordova-plugin-db.git#release-4.6.0
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
cordova-plugin=cordova-sqlite-storage
cordova plugin=cordova-plugin-googleplus
cordova-pligin=cordova-plugin-camera
cordova-plugin=https://github.com/vishwanath1004/cordova-plugin-camera.git
[email protected]
cordova-plugin=cordova-plugin-filechooser
cordova-plugin=cordova-plugin-media
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export class AttachmentService {
{
text: this.texts["FRMELEMNTS_MSG_USE_FILE"],
handler: () => {
console.log(path,"oath");
path ? this.openLocalLibrary() : this.openFile();
return false;
},
Expand Down Expand Up @@ -115,7 +114,7 @@ export class AttachmentService {
text: this.texts["FRMELEMENTS_LBL_UPLOAD_IMAGE"],
icon: "cloud-upload",
handler: () => {
this.openLocalLibrary()
this.takePicture(this.camera.PictureSourceType.PHOTOLIBRARY, this.camera.MediaType.PICTURE);
return false;
},
},
Expand Down Expand Up @@ -160,7 +159,7 @@ export class AttachmentService {
.then((imagePath) => {
if (this.platform.is("android") && sourceType === this.camera.PictureSourceType.PHOTOLIBRARY) {
let newFilePath = imagePath;
if (!newFilePath.includes("file://")) {
if (!newFilePath.includes("content://") && !newFilePath.includes("file://")) {
newFilePath = "file://" + imagePath
}
this.checkForFileSizeRestriction(newFilePath).then(isValidFile => {
Expand Down Expand Up @@ -221,7 +220,8 @@ export class AttachmentService {

checkForFileSizeRestriction(filePath): Promise<Boolean> {
return new Promise((resolve, reject) => {
this.file.resolveLocalFilesystemUrl(filePath).then(success => {
this.filePath.resolveNativePath(filePath).then(fileData =>{
this.file.resolveLocalFilesystemUrl(fileData).then(success => {
success.getMetadata((metadata) => {
if (metadata.size > localStorageConstants.FILE_LIMIT) {
this.presentToast(this.texts["FRMELEMNTS_LBL_FILE_SIZE_EXCEEDED"],'danger', 5000);
Expand All @@ -233,6 +233,9 @@ export class AttachmentService {
}).catch(error => {
reject(false)
})
}).catch(error => {
reject(false)
})
})
}

Expand Down

0 comments on commit 5e6b8e8

Please sign in to comment.