fix blocked/muted status
This commit is contained in:
parent
eb8fbd59ca
commit
c224b081fa
2 changed files with 9 additions and 3 deletions
|
@ -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');
|
||||
});
|
||||
|
|
|
@ -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});
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue