This commit is contained in:
Peter Maquiran
2022-02-07 20:18:48 +01:00
parent 202b430966
commit 0d9adb0bb8
9 changed files with 97 additions and 57 deletions
+19 -13
View File
@@ -155,22 +155,28 @@ export class AuthService {
if(message.hasFile) {
if(message.file.type != 'application/webtrix') {
const formData = message.temporaryData
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path
await this.storage.set(guid.path, message.file.image_url).then(() => {
console.log('add picture to chat IMAGE SAVED')
message.getFileFromDb()
});
return true
try {
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path
await this.storage.set(guid.path, message.file.image_url).then(() => {
console.log('add picture to chat IMAGE SAVED')
message.getFileFromDb()
return true
});
} catch(e) {}
} else {
const res = message.temporaryData
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
message.attachments[0].title_link = url_no_options
message.attachments[0].message_link = url_no_options
try {
const res = message.temporaryData
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
message.attachments[0].title_link = url_no_options
message.attachments[0].message_link = url_no_options
return true
return true
} catch(e) {}
}
}