FIX: ensures user has groups

This commit is contained in:
Joffrey JAFFEUX 2019-09-16 11:35:45 -07:00
parent 2acab3ba89
commit 844f96d146
1 changed files with 4 additions and 1 deletions

View File

@ -12,10 +12,13 @@ export default Ember.Component.extend({
init(args) { init(args) {
this.set("group", args.group); this.set("group", args.group);
if (this.currentUser.groups.some(g => g.id === this.group.id)) { if (
(this.get("currentUser.groups") || []).some(g => g.id === this.group.id)
) {
// User is a part of the group. Now check if the group has reports // User is a part of the group. Now check if the group has reports
this.checkForReports(); this.checkForReports();
} }
this._super(args); this._super(args);
} }
}); });