Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/chatStorage

This commit is contained in:
Eudes Inácio
2022-01-31 14:56:43 +01:00
5 changed files with 62 additions and 1 deletions
@@ -54,6 +54,18 @@ export class WsChatMethodsService {
})()
/**
* @description when the phone is in the background for a long time it could disconnects from the socket then the socket reconnects automatically,
* when the connection is lost the subscribe is also lost, so we have to subscribe again when reconnection is establish.
*/
this.WsChatService.registerCallback({
type: 'reConnect',
funx: ()=>{
this.subscribeToRoom()
}
})
}
getRoomFromDb() {
@@ -126,11 +138,17 @@ export class WsChatMethodsService {
this.loadingWholeList = false
}
/**
* @description sort room list by last message date
*/
sortRoomList() {
this._dm = this.sortService.sortDate(this._dm,'_updatedAt').reverse()
this._group = this.sortService.sortDate(this._group,'_updatedAt').reverse()
}
/**
* @description subscribe all room
*/
subscribeToRoom() {
for (const id in this.dm) {