Skip to content

Commit

Permalink
Update ui/app/selectors/permissions.js
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
  • Loading branch information
rekmarks and Gudahtt authored Jun 9, 2020
1 parent e973d99 commit 3559a53
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ui/app/selectors/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,15 @@ export function getLastConnectedInfo (state) {

export function getPermissionsMetadataHostCounts (state) {
const metadata = getPermissionDomainsMetadata(state)
return Object.values(metadata).reduce((acc, val) => {
const { host } = val
return Object.values(metadata).reduce((counts, { host }) => {
if (host) {
if (!acc[host]) {
acc[host] = 1
if (!counts[host]) {
counts[host] = 1
} else {
acc[host] += 1
counts[host] += 1
}
}
return acc
return counts
}, {})
}

Expand Down

0 comments on commit 3559a53

Please sign in to comment.