This commit is contained in:
tiago.kayaya
2022-02-09 15:27:10 +01:00
parent d04e50312e
commit 5fcb331f7e
2 changed files with 9 additions and 9 deletions
+7 -7
View File
@@ -112,7 +112,7 @@ export class AuthService {
//user: UserForm
async loginChat() {
const expirationMinutes = 60;
const expirationMinutes = 30;
let date = new Date().getTime();
let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000);
@@ -199,7 +199,7 @@ export class AuthService {
}
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
console.log('FILE TYPE', message.file.type)
let downloadFile = "";
@@ -207,20 +207,20 @@ export class AuthService {
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
console.log('FILE TYPE 22', message.file.guid)
if (event.type === HttpEventType.DownloadProgress) {
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
console.log('FILE TYPE 33', message.file.type)
return true
} else if (event.type === HttpEventType.Response) {
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
message.file = {
guid: message.file.guid,
image_url: downloadFile,
type: message.file.type
}
await this.storage.set(message.file.guid, downloadFile).then(() => {
console.log('IMAGE SAVED')
});
@@ -228,10 +228,10 @@ export class AuthService {
}
return false
}
};
}, 1)