From a58211c0dd779e8e10a227b0ef5a544822482613 Mon Sep 17 00:00:00 2001 From: ryanml Date: Mon, 20 Sep 2021 13:19:35 -0700 Subject: [PATCH] Fixing ledger steps display (Confirm TX) (#12163) * Fixing ledger steps display (Confirm TX) * Hiding step two on Firefox --- .../confirm-transaction-base.component.js | 11 +++++++---- .../confirm-transaction-base.container.js | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js index 6714f0a9d..c9a70540e 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -123,7 +123,7 @@ export default class ConfirmTransactionBase extends Component { maxPriorityFeePerGas: PropTypes.string, baseFeePerGas: PropTypes.string, gasFeeIsCustom: PropTypes.bool, - isLedgerAccount: PropTypes.bool.isRequired, + showLedgerSteps: PropTypes.bool.isRequired, isFirefox: PropTypes.bool.isRequired, }; @@ -303,7 +303,7 @@ export default class ConfirmTransactionBase extends Component { primaryTotalTextOverrideMaxAmount, maxFeePerGas, maxPriorityFeePerGas, - isLedgerAccount, + showLedgerSteps, isFirefox, } = this.props; const { t } = this.context; @@ -418,7 +418,7 @@ export default class ConfirmTransactionBase extends Component { ); }; - const ledgerInstructionField = isLedgerAccount ? ( + const ledgerInstructionField = showLedgerSteps ? (
@@ -428,7 +428,10 @@ export default class ConfirmTransactionBase extends Component { `- ${t('ledgerLiveDialogStepOne')}`, !isFirefox, )} - {renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepTwo')}`)} + {renderLedgerLiveStep( + `- ${t('ledgerLiveDialogStepTwo')}`, + !isFirefox, + )} {renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepThree')}`)} {renderLedgerLiveStep( `- ${t('ledgerLiveDialogStepFour')}`, diff --git a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js index 251edb1ca..c85406b36 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -29,7 +29,7 @@ import { getShouldShowFiat, checkNetworkAndAccountSupports1559, getPreferences, - getAccountType, + getHardwareWalletType, } from '../../selectors'; import { getMostRecentOverviewPage } from '../../ducks/history/history'; import { @@ -165,7 +165,7 @@ const mapStateToProps = (state, ownProps) => { const gasFeeIsCustom = fullTxData.userFeeLevel === 'custom' || txParamsAreDappSuggested(fullTxData); - const isLedgerAccount = getAccountType(state) === KEYRING_TYPES.LEDGER; + const showLedgerSteps = getHardwareWalletType(state) === KEYRING_TYPES.LEDGER; const isFirefox = getPlatform() === PLATFORM_FIREFOX; return { @@ -214,7 +214,7 @@ const mapStateToProps = (state, ownProps) => { maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas, baseFeePerGas: gasEstimationObject.baseFeePerGas, gasFeeIsCustom, - isLedgerAccount, + showLedgerSteps, isFirefox, }; };