This commit is contained in:
Peter Maquiran
2024-03-26 13:58:09 +01:00
3884 changed files with 1963136 additions and 404 deletions
@@ -889,7 +889,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
fileBase64 = await this._getBase64(file)
formData = new FormData();
formData.append('blobFile', blob);
formData.append('blobFile', file);
}
this.ChatSystemService.getGroupRoom(roomId).send({
@@ -1023,11 +1023,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
downloadFileFromBrowser(fileName: string, data: any): void {
const linkSource = data;
const downloadLink = document.createElement("a");
downloadLink.href = linkSource;
downloadLink.download = fileName;
downloadLink.click();
const link = document.createElement("a")
link.href = `data:${data.type}';base64,${data.image_url}`;
link.download = fileName
link.click()
link.remove()
}
b64toBlob(b64Data, contentType) {
@@ -1109,10 +1110,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
modal.present();
} else {
this.downloadFileFromBrowser("file", str)
this.downloadFileFromBrowser(msg.attachments[0].title, msg.attachments[0])
}
} else {
this.openFile(str, msg.attachments[0].title, msg.file.type);
this.openFile(msg.attachments.image_url, msg.attachments[0].title, msg.file.type);
}
}