1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fixing ledger steps display (Confirm TX) (#12163)

* Fixing ledger steps display (Confirm TX)

* Hiding step two on Firefox
This commit is contained in:
ryanml 2021-09-20 13:19:35 -07:00 committed by GitHub
parent 9929820b88
commit aba2c71948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -125,7 +125,7 @@ export default class ConfirmTransactionBase extends Component {
baseFeePerGas: PropTypes.string, baseFeePerGas: PropTypes.string,
isMainnet: PropTypes.bool, isMainnet: PropTypes.bool,
gasFeeIsCustom: PropTypes.bool, gasFeeIsCustom: PropTypes.bool,
isLedgerAccount: PropTypes.bool.isRequired, showLedgerSteps: PropTypes.bool.isRequired,
isFirefox: PropTypes.bool.isRequired, isFirefox: PropTypes.bool.isRequired,
nativeCurrency: PropTypes.string, nativeCurrency: PropTypes.string,
}; };
@ -307,7 +307,7 @@ export default class ConfirmTransactionBase extends Component {
maxFeePerGas, maxFeePerGas,
maxPriorityFeePerGas, maxPriorityFeePerGas,
isMainnet, isMainnet,
isLedgerAccount, showLedgerSteps,
isFirefox, isFirefox,
} = this.props; } = this.props;
const { t } = this.context; const { t } = this.context;
@ -417,7 +417,7 @@ export default class ConfirmTransactionBase extends Component {
); );
}; };
const ledgerInstructionField = isLedgerAccount ? ( const ledgerInstructionField = showLedgerSteps ? (
<div> <div>
<div className="confirm-detail-row"> <div className="confirm-detail-row">
<Dialog type="message"> <Dialog type="message">
@ -427,7 +427,10 @@ export default class ConfirmTransactionBase extends Component {
`- ${t('ledgerLiveDialogStepOne')}`, `- ${t('ledgerLiveDialogStepOne')}`,
!isFirefox, !isFirefox,
)} )}
{renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepTwo')}`)} {renderLedgerLiveStep(
`- ${t('ledgerLiveDialogStepTwo')}`,
!isFirefox,
)}
{renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepThree')}`)} {renderLedgerLiveStep(`- ${t('ledgerLiveDialogStepThree')}`)}
{renderLedgerLiveStep( {renderLedgerLiveStep(
`- ${t('ledgerLiveDialogStepFour')}`, `- ${t('ledgerLiveDialogStepFour')}`,

View File

@ -28,7 +28,7 @@ import {
getShouldShowFiat, getShouldShowFiat,
checkNetworkAndAccountSupports1559, checkNetworkAndAccountSupports1559,
getPreferences, getPreferences,
getAccountType, getHardwareWalletType,
getUseTokenDetection, getUseTokenDetection,
getTokenList, getTokenList,
} from '../../selectors'; } from '../../selectors';
@ -168,7 +168,7 @@ const mapStateToProps = (state, ownProps) => {
const gasFeeIsCustom = const gasFeeIsCustom =
fullTxData.userFeeLevel === 'custom' || fullTxData.userFeeLevel === 'custom' ||
txParamsAreDappSuggested(fullTxData); txParamsAreDappSuggested(fullTxData);
const isLedgerAccount = getAccountType(state) === KEYRING_TYPES.LEDGER; const showLedgerSteps = getHardwareWalletType(state) === KEYRING_TYPES.LEDGER;
const isFirefox = getPlatform() === PLATFORM_FIREFOX; const isFirefox = getPlatform() === PLATFORM_FIREFOX;
const nativeCurrency = getNativeCurrency(state); const nativeCurrency = getNativeCurrency(state);
@ -217,7 +217,7 @@ const mapStateToProps = (state, ownProps) => {
maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas, maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas,
baseFeePerGas: gasEstimationObject.baseFeePerGas, baseFeePerGas: gasEstimationObject.baseFeePerGas,
gasFeeIsCustom, gasFeeIsCustom,
isLedgerAccount, showLedgerSteps,
isFirefox, isFirefox,
nativeCurrency, nativeCurrency,
}; };