diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 82b4af93b0ef..3dec8bb4c277 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -452,6 +452,9 @@ "currencyConversion": { "message": "Currency Conversion" }, + "currentExtension": { + "message": "Current extension page" + }, "currentLanguage": { "message": "Current Language" }, diff --git a/ui/app/pages/connected-accounts/connected-accounts.component.js b/ui/app/pages/connected-accounts/connected-accounts.component.js index 6b1aec1585b5..6860837f181c 100644 --- a/ui/app/pages/connected-accounts/connected-accounts.component.js +++ b/ui/app/pages/connected-accounts/connected-accounts.component.js @@ -20,6 +20,7 @@ export default class ConnectedAccounts extends PureComponent { addPermittedAccount: PropTypes.func.isRequired, connectedAccounts: PropTypes.array.isRequired, permissions: PropTypes.array, + isActiveTabExtension: PropTypes.bool.isRequired, selectedAddress: PropTypes.string.isRequired, removePermittedAccount: PropTypes.func.isRequired, setSelectedAddress: PropTypes.func.isRequired, @@ -34,6 +35,7 @@ export default class ConnectedAccounts extends PureComponent { const { accountToConnect, activeTabOrigin, + isActiveTabExtension, addPermittedAccount, connectedAccounts, history, @@ -50,7 +52,7 @@ export default class ConnectedAccounts extends PureComponent { return ( history.push(DEFAULT_ROUTE)} footerClassName="connected-accounts__footer" diff --git a/ui/app/pages/connected-accounts/connected-accounts.container.js b/ui/app/pages/connected-accounts/connected-accounts.container.js index ae4d3cedc33d..841924182114 100644 --- a/ui/app/pages/connected-accounts/connected-accounts.container.js +++ b/ui/app/pages/connected-accounts/connected-accounts.container.js @@ -8,6 +8,8 @@ import { } from '../../selectors' import { addPermittedAccount, removePermittedAccount, setSelectedAddress } from '../../store/actions' +const EXT_PROTOCOLS = ['chrome-extension:', 'moz-extension:'] + const mapStateToProps = (state) => { const { activeTab } = state const accountToConnect = getAccountToConnectToActiveTab(state) @@ -15,8 +17,10 @@ const mapStateToProps = (state) => { const permissions = getPermissionsForActiveTab(state) const selectedAddress = getSelectedAddress(state) + const isActiveTabExtension = EXT_PROTOCOLS.includes(activeTab.protocol) return { accountToConnect, + isActiveTabExtension, activeTabOrigin: activeTab.origin, connectedAccounts, permissions,