Permalink
Browse files

Step 16.5: Add isPublic and isInvited properties

  • Loading branch information...
1 parent c5edc75 commit 4a4b8d5aa0ee5d0cb58ebc24c78510f8048dee51 @dotansimha dotansimha committed with DAB0mB Sep 27, 2016
Showing with 16 additions and 1 deletion.
  1. +16 −1 client/imports/app/parties/party-details.component.ts
@@ -81,7 +81,8 @@ export class PartyDetailsComponent implements OnInit, OnDestroy {
$set: {
name: this.party.name,
description: this.party.description,
- location: this.party.location
+ location: this.party.location,
+ 'public': this.party.public
}
});
}
@@ -106,6 +107,20 @@ export class PartyDetailsComponent implements OnInit, OnDestroy {
return this.party && this.user && this.user._id === this.party.owner;
}
+ get isPublic(): boolean {
+ return this.party && this.party.public;
+ }
+
+ get isInvited(): boolean {
+ if (this.party && this.user) {
+ const invited = this.party.invited || [];
+
+ return invited.indexOf(this.user._id) !== -1;
+ }
+
+ return false;
+ }
+
ngOnDestroy() {
this.paramsSub.unsubscribe();
this.partySub.unsubscribe();

0 comments on commit 4a4b8d5

Please sign in to comment.