Remove relevant console log,

This commit is contained in:
Eudes Inácio
2022-04-28 09:32:27 +01:00
parent 3021e8b0e1
commit 2826cea9df
153 changed files with 1001 additions and 1132 deletions
@@ -132,7 +132,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
console.log(this.roomId);
this.loggedUser = this.loggedUserChat;
this.getRoomInfo();
this.scrollToBottom();
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.getRoomMessageDB(this.roomId);
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
})
VoiceRecorder.requestAudioRecordingPermission();
//this.loadFiles();
@@ -154,7 +154,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
status: status,
}
// this.chatService.setUserStatus(body).subscribe(res => {
// console.log(res);
//
// })
}
@@ -221,19 +221,19 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
path: fileName,
directory: Directory.Data
})
//console.log(audioFile);
//
const base64sound = audioFile.data;
//Converting base64 to blob
const base64 = await fetch(base64sound);
//console.log(base64);
//
const base64Response = await fetch(`data:audio/ogg;base64,${base64sound}`);
//console.log(base64Response);
//
this.audioRecorded = base64Response.url;
console.log(this.audioRecorded);
}
@@ -261,13 +261,13 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log('==================================', result);
this.recording = false;
if (result.value && result.value.recordDataBase64) {
@@ -277,7 +277,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
await this.storage.set('fileName', fileName)
this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved', result);
setTimeout(async () => {
this.loadFiles();
@@ -337,7 +337,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
@@ -375,10 +375,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
async getChatMembers() {
this.chatService.getAllUsers().subscribe(res => {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
console.log(this.allUsers);
});
}
@@ -402,7 +402,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//If group is private call getGroupMembers
if (this.room.t === 'p') {
this.chatService.getGroupMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -410,7 +410,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Otherwise call getChannelMembers for públic groups
else {
this.chatService.getChannelMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
@@ -475,7 +475,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -510,11 +510,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data == 'leave') {
console.log('saiu do grupo');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
}
else if (res.data == 'cancel') {
console.log('cancel');
}
else if (res.data == 'edit') {
this.editGroup(this.roomId);
@@ -593,7 +593,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
console.log(this.attendees);
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -700,16 +700,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData();
formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getGroupRoom(roomId).send({
file: {
@@ -726,7 +726,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
} else {
console.log('File type invalid')
}
}
@@ -745,14 +745,14 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
console.log('Error: ', error);
};
});
}
async openChatOptions(ev?: any) {
console.log(this.members);
const roomId = this.roomId;
const popover = await this.popoverController.create({
@@ -768,7 +768,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
await popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -790,7 +790,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async addContacts() {
console.log(this.members);
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -821,7 +821,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res.data);
this.getRoomInfo();
//this.modalController.dismiss(res.data);
});
@@ -833,18 +833,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
buttons: [{
text: 'Sair do grupo',
handler: () => {
console.log('Delete clicked');
}
}, {
text: 'Alterar nome do grupo1',
handler: () => {
console.log('Alterar nome do grupo');
this.openChangeGroupName()
}
}, {
text: 'Apagar o grupo',
handler: () => {
console.log('Play clicked');
}
},
]
@@ -857,11 +857,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = [];
let array = []
msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = {
_id: element.Id,
@@ -881,7 +881,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
// this.messages = chatmsgArray;
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
})
}
}
@@ -939,18 +939,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.loadMessages()
let msgOnly = res['messages'].filter(data => data.t != 'au');
//this.messages = msgOnly.reverse();
// console.log('MOBILE MSG ROCKET',this.messages);
//
this.transformDataMSG(msgOnly.reverse());
this.getRoomMessageDB(this.roomId);
// Reconnect in one second
if (this.route.url != "/home/chat") {
console.log("Timer message stop")
} else {
//Check if modal is opened
if (document.querySelector('.isGroupChatOpened')) {
await new Promise(resolve => setTimeout(resolve, 5000));
await this.serverLongPull();
console.log('Timer message running')
}
}
@@ -1040,18 +1040,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else {
pathFile = this.file.externalRootDirectory
}
console.log(pdfString)
console.log(pathFile)
console.log(contentFile)
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
.then(() => console.log('File is opened'))
.catch(e => console.log('Error opening file', e));
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.log('Error writing file', e))
.catch(e => console.error(e))
}
downloadFileMsg(msg: MessageService) {
@@ -1103,7 +1103,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }