remove on room expired

This commit is contained in:
Peter Maquiran
2022-09-30 14:43:10 +01:00
parent cc9be61de4
commit 64ad7bbc7f
3 changed files with 21 additions and 16 deletions
+3
View File
@@ -387,6 +387,9 @@ export class ChatService {
} catch (error) {
this.resetTimer();
setTimeout(async () => {
await this.refreshtoken();
}, 3000)
}
+16 -15
View File
@@ -76,6 +76,7 @@ export class RoomService {
}
sortRoomList = () => {}
chatServiceDeleteRoom = (roomId) => {}
constructor(
public WsChatService: WsChatService,
@@ -231,22 +232,22 @@ export class RoomService {
this.countDownTime = "Expired";
let body = { "roomId": this.id }
this.chatService.getRoomInfo(this.id).subscribe( room =>{
// this.chatService.getRoomInfo(this.id).subscribe( room =>{});
if(this.t === 'p') {
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
});
}
else {
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
});
}
});
if(this.t === 'p') {
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
this.chatServiceDeleteRoom(this.id);
});
}
else {
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
this.chatServiceDeleteRoom(this.id);
});
}
}
@@ -395,6 +395,7 @@ export class WsChatMethodsService {
room.getAllUsers = this.getUsers
room.receiveMessageDelete();
room.sortRoomList = this.sortRoomList
room.chatServiceDeleteRoom = this.deleteRoom
// create individual room
@@ -428,7 +429,7 @@ export class WsChatMethodsService {
}
deleteRoom(roomId) {
deleteRoom =(roomId) => {
this.delete.push(roomId)
delete this.group[roomId];