user without permission cant delete or edit group name

This commit is contained in:
Eudes Inácio
2022-06-13 12:11:35 +01:00
parent 3c716ee3ea
commit 9a1d0c67d2
3 changed files with 16 additions and 8 deletions
@@ -7,9 +7,9 @@
</div>
<div class="buttons">
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
<button (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
<div class="solid"></div>
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button *ngIf="isAdmin" (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
</div>
</ion-content>
@@ -6,6 +6,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { HttpErrorResponse } from '@angular/common/http';
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -17,6 +18,7 @@ export class ChatPopoverPage implements OnInit {
roomId:string;
room: any;
members:any;
isAdmin = false;
constructor(
private popoverController: PopoverController,
@@ -29,6 +31,7 @@ export class ChatPopoverPage implements OnInit {
) {
this.roomId = this.navParams.get('roomId');
this.members = this.navParams.get('members');
this.isAdmin = this.navParams.get('isAdmin');
}
ngOnInit() {
@@ -63,6 +66,7 @@ export class ChatPopoverPage implements OnInit {
componentProps: {
roomId: this.roomId,
members: this.members,
isAdmin: this.isAdmin
}
});
await modal.present();