remove promise bug

This commit is contained in:
Eudes Inácio
2022-12-20 17:06:19 +01:00
parent c8d62760ce
commit 111214d231
22 changed files with 128 additions and 42 deletions
+6 -1
View File
@@ -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) {}
+17 -5
View File
@@ -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
}
})
+7 -5
View File
@@ -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
}