Skip to content

Instantly share code, notes, and snippets.

@jakelear
Last active April 9, 2018 20:44
Show Gist options
  • Save jakelear/e612e1b859676087e3bc15de380e5c47 to your computer and use it in GitHub Desktop.
Save jakelear/e612e1b859676087e3bc15de380e5c47 to your computer and use it in GitHub Desktop.
user-booleans
hasSolar () {
- return this.data.solarAccounts.length > 0;
+ return this.data.solarAccounts.filter((a) => a.status === 'active').length > 0;
}
hasSupportedUtility () {
- return this.data.utilities.filter((u) => u.supported).length > 0;
+ const supportedUtilityIds = this.data.utilities.filter((u) => u.supported);
+ return this.accounts.filter((a) => supportedUtilityIds.includes(a.utilityId)).length > 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment