mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 21:04:32 +00:00
main: don't attempt to close already closed wallet
This commit is contained in:
parent
0461a28701
commit
f666e6f42e
1 changed files with 22 additions and 19 deletions
11
main.qml
11
main.qml
|
@ -239,7 +239,6 @@ ApplicationWindow {
|
||||||
if (typeof currentWallet !== "undefined" && currentWallet !== null) {
|
if (typeof currentWallet !== "undefined" && currentWallet !== null) {
|
||||||
console.log("Daemon change - closing " + currentWallet)
|
console.log("Daemon change - closing " + currentWallet)
|
||||||
closeWallet();
|
closeWallet();
|
||||||
currentWallet = undefined
|
|
||||||
} else if (!walletInitialized) {
|
} else if (!walletInitialized) {
|
||||||
// set page to transfer if not changing daemon
|
// set page to transfer if not changing daemon
|
||||||
middlePanel.state = "Transfer";
|
middlePanel.state = "Transfer";
|
||||||
|
@ -286,7 +285,13 @@ ApplicationWindow {
|
||||||
function closeWallet(callback) {
|
function closeWallet(callback) {
|
||||||
|
|
||||||
// Disconnect all listeners
|
// Disconnect all listeners
|
||||||
if (typeof currentWallet !== "undefined" && currentWallet !== null) {
|
if (typeof currentWallet === "undefined" || currentWallet === null) {
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
currentWallet.heightRefreshed.disconnect(onHeightRefreshed);
|
currentWallet.heightRefreshed.disconnect(onHeightRefreshed);
|
||||||
currentWallet.refreshed.disconnect(onWalletRefresh)
|
currentWallet.refreshed.disconnect(onWalletRefresh)
|
||||||
currentWallet.updated.disconnect(onWalletUpdate)
|
currentWallet.updated.disconnect(onWalletUpdate)
|
||||||
|
@ -303,7 +308,6 @@ ApplicationWindow {
|
||||||
middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable);
|
middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable);
|
||||||
middlePanel.getProofClicked.disconnect(handleGetProof);
|
middlePanel.getProofClicked.disconnect(handleGetProof);
|
||||||
middlePanel.checkProofClicked.disconnect(handleCheckProof);
|
middlePanel.checkProofClicked.disconnect(handleCheckProof);
|
||||||
}
|
|
||||||
|
|
||||||
currentWallet = undefined;
|
currentWallet = undefined;
|
||||||
|
|
||||||
|
@ -1122,7 +1126,6 @@ ApplicationWindow {
|
||||||
clearMoneroCardLabelText();
|
clearMoneroCardLabelText();
|
||||||
walletInitialized = false;
|
walletInitialized = false;
|
||||||
closeWallet(function() {
|
closeWallet(function() {
|
||||||
currentWallet = undefined;
|
|
||||||
wizard.restart();
|
wizard.restart();
|
||||||
wizard.wizardState = "wizardHome";
|
wizard.wizardState = "wizardHome";
|
||||||
rootItem.state = "wizard"
|
rootItem.state = "wizard"
|
||||||
|
|
Loading…
Reference in a new issue