-
Notifications
You must be signed in to change notification settings - Fork 131
Only show + icon when we have at least one connected CF #3211
Conversation
✅ Hey nwmac! The commit authors and yourself have already signed the CLA. |
Codecov Report
@@ Coverage Diff @@
## v2-master #3211 +/- ##
============================================
+ Coverage 71.09% 71.1% +<.01%
============================================
Files 632 632
Lines 27752 27753 +1
Branches 6314 6315 +1
============================================
+ Hits 19731 19734 +3
+ Misses 8021 8019 -2 |
|
||
this.haveConnectedCf$ = cloudFoundryService.cFEndpoints$.pipe( | ||
map(endpoints => endpoints.map(endpoint => endpoint.connectionStatus === 'connected')), | ||
map(connected => connected.reduce((a, v) => a || v, false)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like !!connected.find(isConnected => isConnected)
would be more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even just !!endpoints.find(endpoint => endpoint.connectionStatus === 'connected'))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I just used what we had in the CF page - but can have a look at simplifying
Fixes #2714