Last active
April 9, 2018 20:44
-
-
Save jakelear/e612e1b859676087e3bc15de380e5c47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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