From aba2c7194849f4ada3cf135ad9b61841b86cadfb 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 f555e1923..65d366970 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -125,7 +125,7 @@ export default class ConfirmTransactionBase extends Component { baseFeePerGas: PropTypes.string, isMainnet: PropTypes.bool, gasFeeIsCustom: PropTypes.bool, - isLedgerAccount: PropTypes.bool.isRequired, + showLedgerSteps: PropTypes.bool.isRequired, isFirefox: PropTypes.bool.isRequired, nativeCurrency: PropTypes.string, }; @@ -307,7 +307,7 @@ export default class ConfirmTransactionBase extends Component { maxFeePerGas, maxPriorityFeePerGas, isMainnet, - isLedgerAccount, + showLedgerSteps, isFirefox, } = this.props; const { t } = this.context; @@ -417,7 +417,7 @@ export default class ConfirmTransactionBase extends Component { ); }; - const ledgerInstructionField = isLedgerAccount ? ( + const ledgerInstructionField = showLedgerSteps ? (
@@ -427,7 +427,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 54b8ee39f..b7d8b8592 100644 --- a/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js +++ b/ui/pages/confirm-transaction-base/confirm-transaction-base.container.js @@ -28,7 +28,7 @@ import { getShouldShowFiat, checkNetworkAndAccountSupports1559, getPreferences, - getAccountType, + getHardwareWalletType, getUseTokenDetection, getTokenList, } from '../../selectors'; @@ -168,7 +168,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; const nativeCurrency = getNativeCurrency(state); @@ -217,7 +217,7 @@ const mapStateToProps = (state, ownProps) => { maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas, baseFeePerGas: gasEstimationObject.baseFeePerGas, gasFeeIsCustom, - isLedgerAccount, + showLedgerSteps, isFirefox, nativeCurrency, };