mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -10,17 +10,17 @@ export class MessageModel extends models.Model {
|
|||||||
mentions = ArrayField()
|
mentions = ArrayField()
|
||||||
msg = models.CharField()
|
msg = models.CharField()
|
||||||
rid = models.CharField()
|
rid = models.CharField()
|
||||||
ts = models.CharField()
|
ts = models.CharField({blank:true})
|
||||||
u = JsonField()
|
u = JsonField()
|
||||||
_id = models.CharField({unique:true})
|
_id = models.CharField()
|
||||||
_updatedAt = models.CharField()
|
_updatedAt = models.CharField()
|
||||||
messageSend = models.BooleanField()
|
messageSend = models.BooleanField()
|
||||||
offline = models.BooleanField()
|
offline = models.BooleanField()
|
||||||
viewed = ArrayField()
|
viewed = ArrayField({blank:true})
|
||||||
received = ArrayField()
|
received = ArrayField({blank:true})
|
||||||
localReference = models.CharField({blank:true})
|
localReference = models.CharField({blank:true})
|
||||||
attachments = ArrayField()
|
attachments = ArrayField({blank:true})
|
||||||
file = ArrayField()
|
file = ArrayField({blank:true})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
let audioFile;
|
let audioFile;
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
|
||||||
audioFile = recordData;
|
audioFile = recordData;
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
if(recordData.value.recordDataBase64.includes('data:audio')){
|
||||||
this.audioRecorded = recordData.value.recordDataBase64;
|
this.audioRecorded = recordData.value.recordDataBase64;
|
||||||
@@ -401,6 +401,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.audioRecorded);
|
||||||
|
|
||||||
//Converting base64 to blob
|
//Converting base64 to blob
|
||||||
const encodedData = btoa(this.audioRecorded);
|
const encodedData = btoa(this.audioRecorded);
|
||||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ export class MessageService {
|
|||||||
|
|
||||||
async save() {
|
async save() {
|
||||||
const message = this.getChatObj()
|
const message = this.getChatObj()
|
||||||
|
console.log(message);
|
||||||
|
|
||||||
await MessageModel.update(message)
|
await MessageModel.update(message)
|
||||||
|
|
||||||
|
|||||||
@@ -257,11 +257,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
this.storage.get('recordData').then((recordData) => {
|
this.storage.get('recordData').then((recordData) => {
|
||||||
console.log(recordData);
|
console.log(recordData);
|
||||||
if(recordData.value.recordDataBase64.includes('data:audio')){
|
if(recordData){
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
if(recordData.value.recordDataBase64.includes('data:audio')){
|
||||||
}
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
|
||||||
else{
|
}
|
||||||
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
else{
|
||||||
|
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -389,6 +391,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(this.audioRecorded);
|
||||||
|
|
||||||
//Converting base64 to blob
|
//Converting base64 to blob
|
||||||
const encodedData = btoa(this.audioRecorded);
|
const encodedData = btoa(this.audioRecorded);
|
||||||
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
|
||||||
|
|||||||
Reference in New Issue
Block a user