aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2024-08-11 23:58:37 -0300
committerAva Chow <github@achow101.com>2024-08-13 11:25:38 -0400
commitc3918583dd5fcd9001136da2192e02e092128901 (patch)
treed21bce983896c3b5f80b33391b3346b810e13b42
parentbfba63880fbb1108b73540faeb0620ba24b8cdd0 (diff)
gui: don't remove wallet manually before migration
-rw-r--r--src/qt/walletcontroller.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qt/walletcontroller.cpp b/src/qt/walletcontroller.cpp
index ca7c00da41..6f7049e51b 100644
--- a/src/qt/walletcontroller.cpp
+++ b/src/qt/walletcontroller.cpp
@@ -150,9 +150,10 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
assert(called);
connect(wallet_model, &WalletModel::unload, this, [this, wallet_model] {
- // Defer removeAndDeleteWallet when no modal widget is active.
+ // Defer removeAndDeleteWallet when no modal widget is actively waiting for an action.
// TODO: remove this workaround by removing usage of QDialog::exec.
- if (QApplication::activeModalWidget()) {
+ QWidget* active_dialog = QApplication::activeModalWidget();
+ if (active_dialog && dynamic_cast<QProgressDialog*>(active_dialog) == nullptr) {
connect(qApp, &QApplication::focusWindowChanged, wallet_model, [this, wallet_model]() {
if (!QApplication::activeModalWidget()) {
removeAndDeleteWallet(wallet_model);
@@ -463,8 +464,6 @@ void MigrateWalletActivity::migrate(WalletModel* wallet_model)
// GUI needs to remove the wallet so that it can actually be unloaded by migration
const std::string name = wallet_model->wallet().getWalletName();
- m_wallet_controller->removeAndDeleteWallet(wallet_model);
-
showProgressDialog(tr("Migrate Wallet"), tr("Migrating Wallet <b>%1</b>…").arg(GUIUtil::HtmlEscape(name)));
QTimer::singleShot(0, worker(), [this, name, passphrase] {