mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
user without permission cant delete or edit group name
This commit is contained in:
@@ -75,6 +75,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
scrollToBottomBtn = false;
|
||||
roomCountDownDate: string;
|
||||
roomCountDownTime: string;
|
||||
isAdmin = false;
|
||||
|
||||
@Input() roomId: string;
|
||||
@Output() closeAllDesktopComponents: EventEmitter<any> = new EventEmitter<any>();
|
||||
@@ -101,7 +102,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
|
||||
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||
sessionStore = SessionStore
|
||||
groupAdminId = "";
|
||||
|
||||
constructor(
|
||||
public wsChatMethodsService: WsChatMethodsService,
|
||||
@@ -404,10 +404,16 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||
console.log('ROOM',room)
|
||||
this.room = room['room'];
|
||||
this.groupAdminId = this.room.u._id;
|
||||
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;
|
||||
@@ -506,8 +512,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
}
|
||||
|
||||
async openGroupMessagesOptions() {
|
||||
alert(this.groupAdminId)
|
||||
if(SessionStore.user.ChatData.data.userId == this.groupAdminId) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
@@ -554,6 +558,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
componentProps: {
|
||||
roomId: this.roomId,
|
||||
members: this.members,
|
||||
isAdmin: this.isAdmin
|
||||
}
|
||||
});
|
||||
await modal.present();
|
||||
@@ -583,7 +588,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user