preview doc on chat solved

This commit is contained in:
Equilibrium ITO
2024-03-18 11:13:34 +01:00
parent a52ff2aef8
commit c08531a630
3861 changed files with 1962946 additions and 270 deletions
+8 -5
View File
@@ -446,6 +446,8 @@ export class MessageService {
this.downloadLoader = true;
let downloadFile = "";
let downloadUrl = "";
this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => {
console.log('download file',event)
@@ -456,10 +458,10 @@ export class MessageService {
if (this.file.type == "application/img") {
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
} else if (this.file.type != "application/img") {
downloadFile = event.url
/*
let */
/* downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); */
downloadFile = btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
downloadUrl = event.url
console.log('downloaded file', downloadFile)
console.log('event body downloaded file', event.url)
@@ -471,7 +473,8 @@ export class MessageService {
title: this.attachments[0].title,
title_link: downloadFile,
title_link_download: this.attachments[0].title_link_download,
ts: this.attachments[0].ts
ts: this.attachments[0].ts,
attachmentsUrl: downloadUrl
}
// save the changes to the storage