Bug on group chat options for admin

This commit is contained in:
Eudes Inácio
2022-07-01 14:28:57 +01:00
parent 93b7004410
commit 311996797b
3 changed files with 25 additions and 1 deletions
@@ -16,5 +16,8 @@
"sound" "sound"
] ]
} }
},
"server": {
"url": "http://192.168.0.60:8100"
} }
} }
+1
View File
@@ -133,6 +133,7 @@
"g": "^2.0.1", "g": "^2.0.1",
"global": "^4.4.0", "global": "^4.4.0",
"hammerjs": "^2.0.8", "hammerjs": "^2.0.8",
"howler": "^2.2.3",
"http-server": "^14.1.1", "http-server": "^14.1.1",
"i": "^0.3.7", "i": "^0.3.7",
"ionic-angular": "^3.9.10", "ionic-angular": "^3.9.10",
@@ -83,6 +83,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
showAvatar = true; showAvatar = true;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
sessionStore = SessionStore sessionStore = SessionStore
isAdmin = false;
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
public popoverController: PopoverController, public popoverController: PopoverController,
@@ -364,7 +365,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} catch (err) { } } catch (err) { }
} }
getRoomInfo() { async getRoomInfo() {
this.showLoader = true; this.showLoader = true;
// this.chatService.getRoomInfo(this.roomId).subscribe(room => { // this.chatService.getRoomInfo(this.roomId).subscribe(room => {
// this.room = room['room']; // this.room = room['room'];
@@ -375,6 +376,24 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
// this.getGroupContacts(this.room); // this.getGroupContacts(this.room);
// this.showLoader = false; // 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() { async getChatMembers() {
@@ -509,6 +528,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
componentProps: { componentProps: {
roomId: this.roomId, roomId: this.roomId,
members: this.members, members: this.members,
isAdmin: this.isAdmin,
}, },
}); });
await modal.present(); await modal.present();