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 userid: string;
|
||||||
private username: string;
|
private username: string;
|
||||||
|
private you_muted: boolean;
|
||||||
|
private you_blocked: boolean;
|
||||||
|
|
||||||
constructor(public navParams: NavParams, public viewCtrl: ViewController,
|
constructor(public navParams: NavParams, public viewCtrl: ViewController,
|
||||||
public toastCtrl: ToastController, public events: Events) {
|
public toastCtrl: ToastController, public events: Events) {
|
||||||
this.userid = this.navParams.data.userid;
|
this.userid = this.navParams.data.userid;
|
||||||
this.username = this.navParams.data.username;
|
this.username = this.navParams.data.username;
|
||||||
|
this.you_muted = this.navParams.data.you_muted;
|
||||||
|
this.you_blocked = this.navParams.data.you_blocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
browse() {
|
browse() {
|
||||||
|
@ -30,7 +34,7 @@ export class ProfileMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
mute() {
|
mute() {
|
||||||
if (this.user.you_muted) {
|
if (this.you_muted) {
|
||||||
pnut.unmute(this.userid).then(res => {
|
pnut.unmute(this.userid).then(res => {
|
||||||
this.presentToast('User unmuted');
|
this.presentToast('User unmuted');
|
||||||
});
|
});
|
||||||
|
@ -43,7 +47,7 @@ export class ProfileMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
block() {
|
block() {
|
||||||
if (this.user.you_blocked) {
|
if (this.you_blocked) {
|
||||||
pnut.unblock(this.userid).then(res => {
|
pnut.unblock(this.userid).then(res => {
|
||||||
this.presentToast('User unblocked');
|
this.presentToast('User unblocked');
|
||||||
});
|
});
|
||||||
|
|
|
@ -131,7 +131,9 @@ export class ProfilePage {
|
||||||
presentProfileMenu(myEvent) {
|
presentProfileMenu(myEvent) {
|
||||||
let popover = this.popoverCtrl.create(ProfileMenu, {
|
let popover = this.popoverCtrl.create(ProfileMenu, {
|
||||||
userid: this.user.id,
|
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});
|
popover.present({ev: myEvent});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue