From c3b29e192af64a29e0c667229e27ca2bccd0f393 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Fri, 29 May 2020 13:14:25 -0500 Subject: [PATCH] hide connected-status on metamask ext (#8703) Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com> --- ui/app/components/app/menu-bar/menu-bar.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/app/components/app/menu-bar/menu-bar.js b/ui/app/components/app/menu-bar/menu-bar.js index 0bf486ae3..99bc50afa 100644 --- a/ui/app/components/app/menu-bar/menu-bar.js +++ b/ui/app/components/app/menu-bar/menu-bar.js @@ -1,4 +1,7 @@ import React, { useState } from 'react' +import extension from 'extensionizer' +import { useHistory } from 'react-router-dom' +import { useSelector } from 'react-redux' import SelectedAccount from '../selected-account' import ConnectedStatusIndicator from '../connected-status-indicator' import AccountOptionsMenu from './account-options-menu' @@ -7,7 +10,7 @@ import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes' import { useI18nContext } from '../../../hooks/useI18nContext' import { useMetricEvent } from '../../../hooks/useMetricEvent' -import { useHistory } from 'react-router-dom' +import { getOriginOfCurrentTab } from '../../../selectors' export default function MenuBar () { const t = useI18nContext() @@ -21,11 +24,14 @@ export default function MenuBar () { const history = useHistory() const [accountOptionsButtonElement, setAccountOptionsButtonElement] = useState(null) const [accountOptionsMenuOpen, setAccountOptionsMenuOpen] = useState(false) + const origin = useSelector(getOriginOfCurrentTab) + + const showStatus = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP && origin !== extension.runtime.id return (
{ - getEnvironmentType() === ENVIRONMENT_TYPE_POPUP + showStatus ? history.push(CONNECTED_ACCOUNTS_ROUTE)} /> : null }