From 3559a5330440ec73c6071a20f8627425e4b16ab2 Mon Sep 17 00:00:00 2001 From: Erik Marks <25517051+rekmarks@users.noreply.github.com> Date: Tue, 9 Jun 2020 13:31:56 -0700 Subject: [PATCH] Update ui/app/selectors/permissions.js Co-authored-by: Mark Stacey --- ui/app/selectors/permissions.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/app/selectors/permissions.js b/ui/app/selectors/permissions.js index 5dabc74c864c..684bedac2ecb 100644 --- a/ui/app/selectors/permissions.js +++ b/ui/app/selectors/permissions.js @@ -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 }, {}) }