Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Eudes Inácio
2024-03-12 12:33:10 +01:00
22 changed files with 202 additions and 81 deletions
+1
View File
@@ -183,6 +183,7 @@ export class AuthService {
setTimeout(() => {
if (SessionStore.user.ChatData?.data) {
this.RochetChatConnectorService.logout();
this.RochetChatConnectorService.connect();
this.RochetChatConnectorService.login().then((message: any) => {
console.log('Chat login', message)
+1 -1
View File
@@ -157,7 +157,7 @@ export class ChatSystemService {
runMainChangeDetector() {
console.log("change")
this.mainChangeDetector()
// this.mainChangeDetector()
}
loadChat() {
+3
View File
@@ -448,6 +448,8 @@ export class MessageService {
let downloadFile = "";
this.AttachmentsService.downloadFile(this.file.guid).subscribe(async (event) => {
console.log('download file',event)
if (event.type === HttpEventType.DownloadProgress) {
} else if (event.type === HttpEventType.Response) {
@@ -456,6 +458,7 @@ export class MessageService {
} else if (this.file.type != "application/img") {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
console.log('downloaded file', downloadFile)
}
+1 -1
View File
@@ -391,7 +391,7 @@ export class RoomService {
this.name = ChatMessage.msg
}
this.changeDetector()
// this.changeDetector()
setTimeout(() => {
done()
}, 5)
@@ -263,5 +263,17 @@ export class FileService {
return new File([u8arr], filename, {type:mime});
}
base64toBlobIos(base64Data, contentType) {
contentType = contentType || '';
const byteCharacters = atob(base64Data);
const byteArray = new Uint8Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteArray[i] = byteCharacters.charCodeAt(i);
}
return new Blob([byteArray], { type: contentType });
}
}