aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordsc <xmrdsc@protonmail.com>2019-04-26 02:44:01 +0200
committerdsc <xmrdsc@protonmail.com>2019-04-26 02:45:07 +0200
commite6a8fcd6cc40736021d3fddaf53ade28f38f0542 (patch)
treea59fc9980d2c622f0c9555ec10f266661a1983f4
parente81cb7e64090f66e72d942b048b69505e490f5c0 (diff)
downloadmonzero-gui-e6a8fcd6cc40736021d3fddaf53ade28f38f0542.tar.gz
monzero-gui-e6a8fcd6cc40736021d3fddaf53ade28f38f0542.tar.xz
monzero-gui-e6a8fcd6cc40736021d3fddaf53ade28f38f0542.zip
Clean up m_wallet before opening new wallets
-rw-r--r--wizard/WizardController.qml11
1 files changed, 11 insertions, 0 deletions
diff --git a/wizard/WizardController.qml b/wizard/WizardController.qml
index daf3816f..35bd0524 100644
--- a/wizard/WizardController.qml
+++ b/wizard/WizardController.qml
@@ -51,6 +51,9 @@ Rectangle {
signal walletCreatedFromDevice(bool success)
function restart() {
+ // Clear up any state, including `m_wallet`, which
+ // is the temp. wallet object whilst creating new wallets.
+ // This function is called automatically by navigating to `wizardHome`.
wizardStateView.state = "wizardHome"
wizardController.walletOptionsName = defaultAccountName;
wizardController.walletOptionsLocation = '';
@@ -71,6 +74,11 @@ Rectangle {
wizardController.walletOptionsSubaddressLookahead = '';
wizardController.remoteNodes = {};
disconnect();
+
+ if (typeof wizardController.m_wallet !== 'undefined'){
+ walletManager.closeWallet();
+ wizardController.m_wallet = undefined;
+ }
}
property var m_wallet;
@@ -166,6 +174,9 @@ Rectangle {
previousView.opacity = 0;
}
+ if(previousView !== null && currentView.viewName === "wizardHome")
+ wizardController.restart();
+
if (currentView) {
stackView.replace(currentView)
// Calls when view is opened