From c518f235997a493d30c08310d2b67158d147b84e Mon Sep 17 00:00:00 2001 From: gutsyphilip Date: Mon, 18 Apr 2022 23:20:47 +0400 Subject: [PATCH] fix: revert to dispatch checkAndHideLedgerModal from createNewAccount thunk --- .../frontend/src/components/accounts/ledger/SetupLedger.js | 6 ++---- .../src/redux/slices/account/createAccountThunks.js | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/components/accounts/ledger/SetupLedger.js b/packages/frontend/src/components/accounts/ledger/SetupLedger.js index 673e169d93..6b72c22808 100644 --- a/packages/frontend/src/components/accounts/ledger/SetupLedger.js +++ b/packages/frontend/src/components/accounts/ledger/SetupLedger.js @@ -31,8 +31,8 @@ import LedgerIcon from '../../svg/LedgerIcon'; import InstructionsModal from './InstructionsModal'; import LedgerHdPaths from './LedgerHdPaths'; -const { setLinkdropAmount } = linkdropActions; const { checkAndHideLedgerModal } = ledgerActions; +const { setLinkdropAmount } = linkdropActions; // FIXME: Use `debug` npm package so we can keep some debug logging around but not spam the console everywhere const ENABLE_DEBUG_LOGGING = false; const debugLog = (...args) => ENABLE_DEBUG_LOGGING && console.log('SetupLedger:', ...args); @@ -105,9 +105,7 @@ const SetupLedger = (props) => { return; } - await dispatch(createNewAccount({ accountId, fundingOptions, recoveryMethod: 'ledger', publicKey, recaptchaToken, path: customLedgerHdPath, handleCloseModal:()=>{ - dispatch(checkAndHideLedgerModal()); - } })).unwrap(); + await dispatch(createNewAccount({ accountId, fundingOptions, recoveryMethod: 'ledger', publicKey, recaptchaToken, path: customLedgerHdPath })).unwrap(); if (fundingOptions?.fundingAmount) { setLinkdropAmount(fundingOptions.fundingAmount); } diff --git a/packages/frontend/src/redux/slices/account/createAccountThunks.js b/packages/frontend/src/redux/slices/account/createAccountThunks.js index 2a0ee8abcc..7f33608dbf 100644 --- a/packages/frontend/src/redux/slices/account/createAccountThunks.js +++ b/packages/frontend/src/redux/slices/account/createAccountThunks.js @@ -4,6 +4,7 @@ import { PublicKey } from 'near-api-js/lib/utils'; import { KeyType } from 'near-api-js/lib/utils/key_pair'; import * as Config from '../../../config'; +import {actions as ledgerActions } from '../../../redux/slices/ledger'; import sendJson from '../../../tmp_fetch_send_json'; import { setReleaseNotesClosed } from '../../../utils/localStorage'; import { CONTRACT_CREATE_ACCOUNT_URL, FUNDED_ACCOUNT_CREATE_URL, IDENTITY_FUNDED_ACCOUNT_CREATE_URL, RELEASE_NOTES_MODAL_VERSION, wallet } from '../../../utils/wallet'; @@ -11,6 +12,8 @@ import { WalletError } from '../../../utils/walletError'; import { finishAccountSetup } from '../../actions/account'; import { SLICE_NAME } from './'; + +const { checkAndHideLedgerModal } = ledgerActions; const { RECAPTCHA_ENTERPRISE_SITE_KEY, NETWORK_ID, @@ -92,7 +95,6 @@ export const createNewAccount = createAsyncThunk( publicKey, previousAccountId, recaptchaToken, - handleCloseModal }, { dispatch }) => { await wallet.checkNewAccount(accountId); @@ -117,7 +119,7 @@ export const createNewAccount = createAsyncThunk( await wallet.saveAndMakeAccountActive(accountId); await dispatch(addLocalKeyAndFinishSetup({ accountId, recoveryMethod, publicKey, previousAccountId })).unwrap(); - handleCloseModal(); + dispatch(checkAndHideLedgerModal()); } );