aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-16 22:51:45 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-16 22:51:45 +0200
commit55f4858a40948da244b1b5c48799d35f69f7a4a3 (patch)
tree09fdcd003facd0e73a7011f855574b83515ed718
parent59ba93bbddeec4db62f4bc1e0e29e42995188fb6 (diff)
parentd119c27e3fe2dc9649512d615025c68c12444c38 (diff)
downloadmonzero-gui-55f4858a40948da244b1b5c48799d35f69f7a4a3.tar.gz
monzero-gui-55f4858a40948da244b1b5c48799d35f69f7a4a3.tar.xz
monzero-gui-55f4858a40948da244b1b5c48799d35f69f7a4a3.zip
Merge pull request #291
d119c27 fixed borked wallet (Jaquee)
-rw-r--r--main.qml29
1 files changed, 14 insertions, 15 deletions
diff --git a/main.qml b/main.qml
index a9d22d5a..0bbe4be3 100644
--- a/main.qml
+++ b/main.qml
@@ -173,19 +173,20 @@ ApplicationWindow {
function closeWallet() {
// Disconnect all listeners
- currentWallet.refreshed.disconnect(onWalletRefresh)
- currentWallet.updated.disconnect(onWalletUpdate)
- currentWallet.newBlock.disconnect(onWalletNewBlock)
- currentWallet.moneySpent.disconnect(onWalletMoneySent)
- currentWallet.moneyReceived.disconnect(onWalletMoneyReceived)
- currentWallet.transactionCreated.disconnect(onTransactionCreated)
- currentWallet.connectionStatusChanged.disconnect(onWalletConnectionStatusChanged)
- middlePanel.paymentClicked.disconnect(handlePayment);
- middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable);
- middlePanel.checkPaymentClicked.disconnect(handleCheckPayment);
-
- walletManager.closeWalletAsync();
+ if (typeof currentWallet !== "undefined" && currentWallet !== null) {
+ currentWallet.refreshed.disconnect(onWalletRefresh)
+ currentWallet.updated.disconnect(onWalletUpdate)
+ currentWallet.newBlock.disconnect(onWalletNewBlock)
+ currentWallet.moneySpent.disconnect(onWalletMoneySent)
+ currentWallet.moneyReceived.disconnect(onWalletMoneyReceived)
+ currentWallet.transactionCreated.disconnect(onTransactionCreated)
+ currentWallet.connectionStatusChanged.disconnect(onWalletConnectionStatusChanged)
+ middlePanel.paymentClicked.disconnect(handlePayment);
+ middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable);
+ middlePanel.checkPaymentClicked.disconnect(handleCheckPayment);
+ }
currentWallet = undefined;
+ walletManager.closeWalletAsync();
}
function connectWallet(wallet) {
@@ -227,8 +228,6 @@ ApplicationWindow {
console.error("Error opening wallet with empty password: ", wallet.errorString);
console.log("closing wallet async : " + wallet.address)
closeWallet();
- currentWallet = undefined
-
// try to open wallet with password;
passwordDialog.open(wallet.path);
} else {
@@ -240,7 +239,6 @@ ApplicationWindow {
informationPopup.icon = StandardIcon.Critical
console.log("closing wallet async : " + wallet.address)
closeWallet();
- currentWallet = undefined
informationPopup.open()
informationPopup.onCloseCallback = function() {
passwordDialog.open(wallet.path)
@@ -616,6 +614,7 @@ ApplicationWindow {
walletInitialized = false;
splashCounter = 0;
closeWallet();
+ currentWallet = undefined;
wizard.restart();
rootItem.state = "wizard"
}