mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
remove promise bug
This commit is contained in:
@@ -183,7 +183,12 @@ export class ChatSystemService {
|
||||
|
||||
async getAllRooms () {
|
||||
this.loadingWholeList = true
|
||||
const rooms = await this.RochetChatConnectorService.getRooms();
|
||||
var rooms;
|
||||
try {
|
||||
rooms = await this.RochetChatConnectorService.getRooms();
|
||||
} catch (error) {
|
||||
console.error('chatgetrooms',error)
|
||||
}
|
||||
try {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
|
||||
@@ -166,7 +166,11 @@ export class MessageService {
|
||||
|
||||
let uploadSuccessfully = false
|
||||
if(this.hasSendAttachment == false) {
|
||||
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
|
||||
try {
|
||||
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
|
||||
} catch (error) {
|
||||
console.error('beforeSendAttachment uploadSuccessfully',error)
|
||||
}
|
||||
this.UploadAttachmentsTemp++
|
||||
}
|
||||
|
||||
@@ -186,13 +190,17 @@ export class MessageService {
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
this.send()
|
||||
this.send().catch((error) =>{
|
||||
console.error(error)
|
||||
})
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
} else if(uploadSuccessfully == false && this.UploadAttachmentsTemp == 1) {
|
||||
this.send()
|
||||
this.send().catch((error) =>{
|
||||
console.error(error)
|
||||
})
|
||||
}
|
||||
else if(uploadSuccessfully == false) {
|
||||
|
||||
@@ -225,7 +233,9 @@ export class MessageService {
|
||||
this.messageSend = true
|
||||
this.redefinedMessage(ChatMessage)
|
||||
}
|
||||
)
|
||||
).catch((error) => {
|
||||
console.error(error)
|
||||
})
|
||||
|
||||
} else {
|
||||
// console.log("reconnect")
|
||||
@@ -233,7 +243,9 @@ export class MessageService {
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
|
||||
this.send()
|
||||
this.send().catch((error) =>{
|
||||
console.error(error)
|
||||
})
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
@@ -630,7 +630,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
if(lastIsTyping != this.isTyping) {
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping).catch((error) => console.error(error));
|
||||
}
|
||||
|
||||
|
||||
@@ -639,7 +639,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendFalseTypingReadMessage(method,param: object) {
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod).catch((error) => console.error(error))
|
||||
this.setTypingOff()
|
||||
}
|
||||
|
||||
@@ -651,7 +651,7 @@ export class RoomService {
|
||||
|
||||
if(this.isTyping == true) {
|
||||
this.isTyping = false
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping).catch((error) => console.error(error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,7 +675,7 @@ export class RoomService {
|
||||
|
||||
|
||||
leave(rid?) {
|
||||
this.RochetChatConnectorService.leaveRoom(this.id)
|
||||
this.RochetChatConnectorService.leaveRoom(this.id).catch((error) => console.error(error))
|
||||
}
|
||||
|
||||
isJson(str) {
|
||||
@@ -1003,7 +1003,9 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendReadMessage() {
|
||||
this.RochetChatConnectorService.readMessage(this.id)
|
||||
this.RochetChatConnectorService.readMessage(this.id).catch((error) =>{
|
||||
console.error(error)
|
||||
})
|
||||
this.sendFalseTypingReadMessage('viewMessage', {})
|
||||
this.messageUnread = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user