mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve
This commit is contained in:
@@ -192,7 +192,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
scrollToBottomClicked = () => {
|
||||
console.log('scroll')
|
||||
try {
|
||||
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||
//this.scrollingOnce = false;
|
||||
@@ -356,6 +355,43 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
|
||||
}
|
||||
|
||||
async sendAudio(fileName) {
|
||||
|
||||
const roomId = this.roomId
|
||||
this.storage.get('recordData').then((recordData) => {
|
||||
console.log(recordData);
|
||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
||||
this.audioRecorded = recordData.value.recordDataBase64;
|
||||
}
|
||||
else{
|
||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
||||
}
|
||||
});
|
||||
|
||||
//Converting base64 to blob
|
||||
const base64Response = await fetch(this.audioRecorded);
|
||||
const blob = await base64Response.blob();
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": "aplication/audio",
|
||||
/* "guid": '', */
|
||||
},
|
||||
attachments: [{
|
||||
"title": fileName ,
|
||||
"title_link": this.audioRecorded,
|
||||
"title_link_download": true,
|
||||
"type": "file"
|
||||
}],
|
||||
temporaryData: formData
|
||||
})
|
||||
this.deleteRecording();
|
||||
|
||||
}
|
||||
|
||||
deleteMessage(msgId: string, msg:MessageService) {
|
||||
|
||||
msg.delateStatusFalse()
|
||||
|
||||
Reference in New Issue
Block a user