From c224b081faea9f44afbf5d36a03a5dab1c8b0eb8 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sun, 18 Nov 2018 20:35:05 -0800 Subject: [PATCH] fix blocked/muted status --- src/pages/profile/profile-menu.ts | 8 ++++++-- src/pages/profile/profile.ts | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/pages/profile/profile-menu.ts b/src/pages/profile/profile-menu.ts index a8cd5b7..3abd9d6 100644 --- a/src/pages/profile/profile-menu.ts +++ b/src/pages/profile/profile-menu.ts @@ -17,11 +17,15 @@ export class ProfileMenu { private userid: string; private username: string; + private you_muted: boolean; + private you_blocked: boolean; constructor(public navParams: NavParams, public viewCtrl: ViewController, public toastCtrl: ToastController, public events: Events) { this.userid = this.navParams.data.userid; this.username = this.navParams.data.username; + this.you_muted = this.navParams.data.you_muted; + this.you_blocked = this.navParams.data.you_blocked; } browse() { @@ -30,7 +34,7 @@ export class ProfileMenu { } mute() { - if (this.user.you_muted) { + if (this.you_muted) { pnut.unmute(this.userid).then(res => { this.presentToast('User unmuted'); }); @@ -43,7 +47,7 @@ export class ProfileMenu { } block() { - if (this.user.you_blocked) { + if (this.you_blocked) { pnut.unblock(this.userid).then(res => { this.presentToast('User unblocked'); }); diff --git a/src/pages/profile/profile.ts b/src/pages/profile/profile.ts index e0d4b61..057eb23 100644 --- a/src/pages/profile/profile.ts +++ b/src/pages/profile/profile.ts @@ -131,7 +131,9 @@ export class ProfilePage { presentProfileMenu(myEvent) { let popover = this.popoverCtrl.create(ProfileMenu, { userid: this.user.id, - username: this.user.username}); + username: this.user.username, + you_muted: this.user.you_muted, + you_blocked: this.user.you_blocked}); popover.present({ev: myEvent}); }