diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 0cb908bc5..57ee012cc 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -787,18 +787,8 @@ export class NewPublicationPage implements OnInit { try { console.log('shared base', content.data) - - const newAttachment = new PublicationAttachmentEntity( - { - base64: this.removeTextBeforeSlash(content.data, ','), - extension: FileExtension, - FileType: this.checkFileType.checkFileType(FileExtension) as any, - OriginalFileName: 'shared' - } - ) - - - this.PublicationFromMvService.form.Files.push(newAttachment) + this.capturedImage = 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','); + this.showCroppModal() } catch (error) { console.log('error shared filesystem', error) } @@ -824,7 +814,7 @@ export class NewPublicationPage implements OnInit { const newAttachment = new PublicationAttachmentEntity( { - base64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), + base64: content.data, extension: 'mp4', FileType: this.checkFileType.checkFileType('mp4') as any, OriginalFileName: 'shared' @@ -864,16 +854,8 @@ export class NewPublicationPage implements OnInit { Filesystem.readFile({ path: resultUrl }).then(async (content) => { try { if (this.checkFileType.checkFileType(FileExtension) == 'image') { - let newAttachment = new PublicationAttachmentEntity( - { - base64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','), - extension: FileExtension, - FileType: this.checkFileType.checkFileType(FileExtension) as any, - OriginalFileName: 'shared' - } - ) - - this.PublicationFromMvService.form.Files.push(newAttachment) + this.capturedImage = 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','); + this.showCroppModal() } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index 95363685d..7b11b0168 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -240,7 +240,7 @@ export class NewPublicationPage implements OnInit { this.convertBlobToBase64(blobFile.blob).then((value: string) => { this.filesSizeSum = this.filesSizeSum + blobFile.size - this.capturedImage = this.removeTextBeforeSlash(value, ','), + this.capturedImage = 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(value, ','), this.showCroppModal(); this.filecontent = true;