This commit is contained in:
tiago.kayaya
2022-02-09 18:18:27 +01:00
parent a6823d9bae
commit da240623dd
2 changed files with 27 additions and 24 deletions
+6 -7
View File
@@ -37,7 +37,7 @@ export class MessageService {
}
setData({customFields, channels, mentions, msg ,rid ,ts, u, t, _id, _updatedAt, file, attachments, temporaryData}:Message) {
this.customFields = customFields
this.customFields = customFields
this.channels = channels || []
this.mentions = mentions || []
this.msg = msg || ""
@@ -78,7 +78,7 @@ export class MessageService {
const firstName = capitalizeTxt(username.split('.')[0])
const lastName = capitalizeTxt(username.split('.')[1])
return firstName + ' ' + lastName
}
}
getFileFromDb() {
@@ -113,14 +113,14 @@ export class MessageService {
if(this.hasSendAttachment == false) {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
}
this.uploadingFile = false
if(uploadSuccessfully || this.hasSendAttachment == false) {
this.hasSendAttachment = true
this.errorUploadingAttachment = false
this.temporaryData = {}
this.WsChatService.send({roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file}).then((data: any) => {
console.log('send sucees', data.result)
let ChatMessage = data.result
@@ -133,7 +133,6 @@ export class MessageService {
this.WsChatService.registerCallback({
type: 'reConnect',
funx:()=> {
alert('reConnect')
// this.send()
return true
}
@@ -143,11 +142,11 @@ export class MessageService {
this.errorUploadingAttachment = true
}
}
}
redefinedMessage(messagem, ChatMessage) {
redefinedMessage(messagem, ChatMessage) {
this.setData(ChatMessage)
}