create room bug solved on web

This commit is contained in:
Eudes Inácio
2022-07-06 17:50:42 +01:00
parent c3af87d5cd
commit 75609ae5b4
2 changed files with 28 additions and 1 deletions
+27 -1
View File
@@ -99,6 +99,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
audioDuration = 0;
audioTimer:any;
@ViewChild('range', {static: false}) range: IonRange;
room: any = new Array();
roomName: any;
isAdmin = false;
roomCountDownDate: string;
constructor(
public popoverController: PopoverController,
@@ -128,6 +132,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnChanges(changes: SimpleChanges): void {
this.wsChatMethodsService.getAllRooms();
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -164,9 +169,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnInit() {
this.wsChatMethodsService.getAllRooms();
this.chatService.refreshtoken();
this.scrollToBottom();
this.getChatMembers();
this.deleteRecording();
@@ -1122,6 +1127,27 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
},1000)
}
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
// console.log('ROOM',room)
this.room = room['room'];
if (this.room.name) {
this.roomName = this.room.name.split('-').join(' ');
}
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
this.isAdmin = true
} else {
this.isAdmin = false
}
if (this.room.customFields.countDownDate) {
this.roomCountDownDate = this.room.customFields.countDownDate;
}
}
}