Merge branch 'develop' into bugfix/chat-create-event

This commit is contained in:
Peter Maquiran
2022-08-03 14:30:13 +01:00
39 changed files with 337 additions and 244 deletions
+7 -19
View File
@@ -27,13 +27,11 @@ import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-vi
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
import { Filesystem, Directory } from '@capacitor/filesystem';
import { DomSanitizer } from '@angular/platform-browser';
import { AlertController, Platform } from '@ionic/angular';
import { Platform } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
import { Howl } from 'howler';
import { runInThisContext } from 'vm';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
@@ -49,8 +47,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
@ViewChild('message-item') messageContainer: ElementRef;
loggedUser: any;
messages: any;
dm: any;
userPresence = '';
@@ -126,7 +122,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private platform: Platform,
private fileOpener: FileOpener,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.checkAudioPermission()
}
@@ -448,15 +443,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
else {
var str = msg.attachments[0].image_url;
str = str.substring(1, ((str.length) - 1));
// var str = msg.attachments[0].image_url;
// str = str.substring(1, ((str.length) - 1));
const encodedData = btoa(str);
// const encodedData = btoa(str);
let file = this.base64toBlob(encodedData, 'application/pdf')
let fileURL = URL.createObjectURL(file)
// let file = this.base64toBlob(encodedData, 'application/pdf')
// let fileURL = URL.createObjectURL(file)
window.open(fileURL);
// window.open(fileURL);
}
}
@@ -1028,7 +1023,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
this.downloadFileMsg(msg)
//this.testDownlod(msg)
} else {
var str = msg.attachments[0].image_url;
@@ -1075,12 +1069,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
testEditMessage(msg: MessageService) {
// msg.receptorReceive()
// alert('cool!')
}
start(track) {
if(this.audioPlay){
this.audioPlay.stop();