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
+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);
});
}
}