Skip to content

Commit

Permalink
do not display extension id in connection modal (#8699)
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-decker authored May 29, 2020
1 parent ad85382 commit e481166
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,9 @@
"currencyConversion": {
"message": "Currency Conversion"
},
"currentExtension": {
"message": "Current extension page"
},
"currentLanguage": {
"message": "Current Language"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -34,6 +35,7 @@ export default class ConnectedAccounts extends PureComponent {
const {
accountToConnect,
activeTabOrigin,
isActiveTabExtension,
addPermittedAccount,
connectedAccounts,
history,
Expand All @@ -50,7 +52,7 @@ export default class ConnectedAccounts extends PureComponent {

return (
<Popover
title={activeTabOrigin}
title={isActiveTabExtension ? t('currentExtension') : activeTabOrigin}
subtitle={connectedAccounts.length ? connectedAccountsDescription : t('connectedAccountsEmptyDescription')}
onClose={() => history.push(DEFAULT_ROUTE)}
footerClassName="connected-accounts__footer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ 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)
const connectedAccounts = getOrderedConnectedAccountsForActiveTab(state)
const permissions = getPermissionsForActiveTab(state)
const selectedAddress = getSelectedAddress(state)

const isActiveTabExtension = EXT_PROTOCOLS.includes(activeTab.protocol)
return {
accountToConnect,
isActiveTabExtension,
activeTabOrigin: activeTab.origin,
connectedAccounts,
permissions,
Expand Down

0 comments on commit e481166

Please sign in to comment.