diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-10 23:56:56 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-10 23:56:56 +0800 |
commit | e905c9f055cf9a5efbfa67a5371f2224934c49ab (patch) | |
tree | b83fc79a2e084244c78b4a6901134def99bbbb65 /ui | |
parent | 814c642d952b8271508b8b091d640084897aedd5 (diff) | |
download | tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.gz tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.zst tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.zip |
hide export private key for trezor accounts
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/modals/account-details-modal.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index 5607cf051..049c75eee 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -14,6 +14,7 @@ function mapStateToProps (state) { return { network: state.metamask.network, selectedIdentity: getSelectedIdentity(state), + keyrings: state.metamask.keyrings, } } @@ -50,9 +51,20 @@ AccountDetailsModal.prototype.render = function () { network, showExportPrivateKeyModal, setAccountLabel, + keyrings, } = this.props const { name, address } = selectedIdentity + const keyring = keyrings.find((kr) => { + return kr.accounts.includes(address) + }) + + let exportPrivateKeyFeatureEnabled = true + if (keyring.type === 'Trezor Hardware') { + exportPrivateKeyFeatureEnabled = false + } + + return h(AccountModalContainer, {}, [ h(EditableLabel, { className: 'account-modal__name', @@ -73,9 +85,11 @@ AccountDetailsModal.prototype.render = function () { }, this.context.t('etherscanView')), // Holding on redesign for Export Private Key functionality - h('button.btn-primary.account-modal__button', { + // This feature is disabled for TREZOR accounts + + exportPrivateKeyFeatureEnabled ? h('button.btn-primary.account-modal__button', { onClick: () => showExportPrivateKeyModal(), - }, this.context.t('exportPrivateKey')), + }, this.context.t('exportPrivateKey')) : null, ]) } |