This commit is contained in:
Peter Maquiran
2022-07-04 14:08:51 +01:00
parent f4d7bcfd23
commit 6674d459b1
6 changed files with 13 additions and 63 deletions
@@ -42,6 +42,8 @@ export class WsChatMethodsService {
sessionStore = SessionStore
loggedUser: any;
delete = []
constructor(
private WsChatService: WsChatService,
@@ -68,7 +70,7 @@ export class WsChatMethodsService {
this.WsChatService.registerCallback({
type: 'reConnect',
funx: ()=>{
funx: () => {
/**
* @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.
@@ -363,10 +365,16 @@ export class WsChatMethodsService {
deleteRoom(roomId) {
this.delete.push(roomId)
delete this.group[roomId];
this._group = this._group.filter((e)=> e.id != roomId);
}
deleteRecently(roomId) {
return this.delete.includes(roomId)
}
roomExist(roomId) {
return this.dm[roomId]?.id || this.group[roomId]?.id
}