mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Bug on group chat options for admin
This commit is contained in:
@@ -83,6 +83,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
showAvatar = true;
|
||||
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||
sessionStore = SessionStore
|
||||
isAdmin = false;
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
@@ -364,7 +365,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
} catch (err) { }
|
||||
}
|
||||
|
||||
getRoomInfo() {
|
||||
async getRoomInfo() {
|
||||
this.showLoader = true;
|
||||
// this.chatService.getRoomInfo(this.roomId).subscribe(room => {
|
||||
// this.room = room['room'];
|
||||
@@ -375,6 +376,24 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
// this.getGroupContacts(this.room);
|
||||
// this.showLoader = false;
|
||||
// });
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
async getChatMembers() {
|
||||
@@ -509,6 +528,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
componentProps: {
|
||||
roomId: this.roomId,
|
||||
members: this.members,
|
||||
isAdmin: this.isAdmin,
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
Reference in New Issue
Block a user