This commit is contained in:
Peter Maquiran
2022-06-03 16:53:50 +01:00
parent 7430bf7fe1
commit ee370f7e2e
29 changed files with 175 additions and 404 deletions
+2 -17
View File
@@ -428,7 +428,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
deleteMessage(msgId: string, msg: MessageService) {
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
if (msg.file.type == "application/webtrix") {
this.openViewDocumentModal(msg.file);
// this.openViewDocumentModal(msg.file);
}
else {
@@ -436,17 +436,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
str = str.substring(1, ((str.length) - 1));
const encodedData = btoa(str);
/* let fullUrl;
fullUrl = "https://gabinetedigitalchat.dyndns.info" + url;
//fullUrl = "http://www.africau.edu/images/default/sample.pdf";
this.frameUrl = fullUrl; */
let file = this.base64toBlob(encodedData, 'application/pdf')
let fileURL = URL.createObjectURL(file)
window.open(fileURL);
// this.chatService.getDocumentDetails(fullUrl);
}
}
@@ -630,9 +625,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
resultType: CameraResultType.Base64,
source: CameraSource.Camera
});
//const imageData = await this.fileToBase64Service.convert(file)
//
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
const blob = await response.blob();
@@ -780,13 +772,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
const file: any = await this.fileService.getFileFromDevice(types);
//if (file.type == "application/pdf") {
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
}) */
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {