From e0826ea10af4143c46517d34cb21cfd970cb02c3 Mon Sep 17 00:00:00 2001 From: Michael Chappell Date: Mon, 15 Nov 2021 17:17:31 +0000 Subject: [PATCH 1/3] fix wallet restore dialog and continue disable check --- .../wallet-restore/StepConfigurationContainer.js | 12 ++++++++---- .../dialogs/wallet-restore/StepSuccessContainer.js | 4 ++-- source/renderer/app/stores/WalletsStore.js | 12 ++++++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.js b/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.js index 713247654e..f9419f1052 100644 --- a/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.js +++ b/source/renderer/app/containers/wallet/dialogs/wallet-restore/StepConfigurationContainer.js @@ -15,7 +15,6 @@ export default class ConfigurationDialogContainer extends Component { handleContinue = () => { this.props.actions.wallets.restoreWallet.trigger(); - this.props.actions.wallets.restoreWalletEnd.trigger(); }; handleChange = (param: string, field: Object) => @@ -28,14 +27,19 @@ export default class ConfigurationDialogContainer extends Component { const { onClose, onBack, stores } = this.props; const { wallets, profile } = stores; const { currentLocale } = profile; - const { error, isExecuting } = wallets.restoreRequest; - const { walletName, spendingPassword, repeatPassword } = wallets; + const { error } = wallets.restoreRequest; + const { + walletName, + spendingPassword, + repeatPassword, + isRestoring, + } = wallets; const { error: certificateError, } = stores.wallets.getWalletRecoveryPhraseFromCertificateRequest; return ( { render() { const { stores, actions } = this.props; const { walletKindDaedalus, walletKindYoroi } = stores.wallets; - const { restoreWalletClose } = actions.wallets; + const { restoreWalletEnd } = actions.wallets; return ( restoreWalletClose.trigger()} + onClose={() => restoreWalletEnd.trigger()} walletKindDaedalus={walletKindDaedalus} walletKindYoroi={walletKindYoroi} /> diff --git a/source/renderer/app/stores/WalletsStore.js b/source/renderer/app/stores/WalletsStore.js index c840137e7d..14508f9bad 100644 --- a/source/renderer/app/stores/WalletsStore.js +++ b/source/renderer/app/stores/WalletsStore.js @@ -172,6 +172,8 @@ export default class WalletsStore extends Store { /* ---------- Delete Wallet ---------- */ @observable isDeleting: boolean = false; + /* ---------- Restore Wallet ---------- */ + @observable isRestoring: boolean = false; /* ---------- Paper Wallet ---------- */ @observable createPaperWalletCertificateStep = 0; @@ -404,6 +406,7 @@ export default class WalletsStore extends Store { const { restoredWallet } = this; if (restoredWallet) { await this._patchWalletRequestWithNewWallet(restoredWallet); + this.goToWalletRoute(restoredWallet.id); this.refreshWalletsData(); this._restoreWalletResetRequests(); this._restoreWalletResetData(); @@ -669,10 +672,12 @@ export default class WalletsStore extends Store { }; _restore = async () => { + runInAction('begin wallet restore', () => { + this.isRestoring = true; + }); // Pause polling in order to avoid fetching data for wallet we are about to restore // so that we remain on the "Add wallet" screen until user closes the TADA screen await this._pausePolling(); - // Reset restore requests to clear previous errors this._restoreWalletResetRequests(); @@ -702,8 +707,11 @@ export default class WalletsStore extends Store { this.restoredWallet = restoredWallet; this.restoreWalletStep = 3; }); - } catch (error) { + } finally { this._resumePolling(); + runInAction('end wallet restore', () => { + this.isRestoring = false; + }); } }; From 96e2d6b8e69e8e5fc786a90ead5532a6e8c88356 Mon Sep 17 00:00:00 2001 From: Nikola Glumac Date: Tue, 16 Nov 2021 12:41:46 +0100 Subject: [PATCH 2/3] Adds CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c928cab29..f329a9cd40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - Fixed issues relating to minimum window size in Daedalus ([PR 2719](https://github.com/input-output-hk/daedalus/pull/2719)) - Updated "Trezor T" image shown on the "Pair a hardware wallet device" dialog ([PR 2712](https://github.com/input-output-hk/daedalus/pull/2712)) - Fixed transaction timestamps localization ([PR 2702](https://github.com/input-output-hk/daedalus/pull/2702)) -- Small UI/UX Fixes ([PR 2685](https://github.com/input-output-hk/daedalus/pull/2685)) +- Small UI/UX Fixes ([PR 2685](https://github.com/input-output-hk/daedalus/pull/2685), [PR 2744](https://github.com/input-output-hk/daedalus/pull/2744)) ### Chores From 983e2ca36f1b45102e006dd631e18c9625e1d03c Mon Sep 17 00:00:00 2001 From: Nikola Glumac Date: Tue, 16 Nov 2021 12:45:58 +0100 Subject: [PATCH 3/3] Change _restore to action --- source/renderer/app/stores/WalletsStore.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/renderer/app/stores/WalletsStore.js b/source/renderer/app/stores/WalletsStore.js index 14508f9bad..347bc11555 100644 --- a/source/renderer/app/stores/WalletsStore.js +++ b/source/renderer/app/stores/WalletsStore.js @@ -671,10 +671,9 @@ export default class WalletsStore extends Store { return unscrambledRecoveryPhrase; }; - _restore = async () => { - runInAction('begin wallet restore', () => { - this.isRestoring = true; - }); + @action _restore = async () => { + this.isRestoring = true; + // Pause polling in order to avoid fetching data for wallet we are about to restore // so that we remain on the "Add wallet" screen until user closes the TADA screen await this._pausePolling();