mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
improve
This commit is contained in:
@@ -95,18 +95,22 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
async send() {
|
||||
async send(): Promise<any> {
|
||||
|
||||
this.sendAttempt++;
|
||||
|
||||
if(!this.hasFile) {
|
||||
this.WsChatService.send({roomId:this.rid, msg:this.msg}).then((data: any) => {
|
||||
if (environment.chatOffline) {
|
||||
let ChatMessage = data.result
|
||||
let ChatMessage = data.result
|
||||
|
||||
if (environment.chatOffline) {
|
||||
this.redefinedMessage(this, ChatMessage)
|
||||
this.offline = false
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject)=>{
|
||||
resolve(ChatMessage)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -125,21 +129,23 @@ export class MessageService {
|
||||
this.temporaryData = {}
|
||||
|
||||
this.WsChatService.send({roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file}).then((data: any) => {
|
||||
if (environment.chatOffline) {
|
||||
// console.log('send sucees', data.result)
|
||||
let ChatMessage = data.result
|
||||
let ChatMessage = data.result
|
||||
|
||||
if (environment.chatOffline) {
|
||||
this.redefinedMessage(this, ChatMessage)
|
||||
this.offline = false
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject)=>{
|
||||
resolve(ChatMessage)
|
||||
})
|
||||
})
|
||||
} else if(this.WsChatService.isLogin == false) {
|
||||
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx:()=> {
|
||||
this.send()
|
||||
return true
|
||||
funx: async ()=> {
|
||||
return await this.send()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user