From 036a5997c7d26fc0b5da10b5e94e673159feb89c Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 6 Feb 2023 12:43:54 +0100 Subject: [PATCH] qml: fix confusion when dialogs not on top of activeDialog stack are closed --- electrum/gui/qml/components/controls/ElDialog.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/components/controls/ElDialog.qml b/electrum/gui/qml/components/controls/ElDialog.qml index 9db30fcc7..dc4e8bc72 100644 --- a/electrum/gui/qml/components/controls/ElDialog.qml +++ b/electrum/gui/qml/components/controls/ElDialog.qml @@ -16,7 +16,12 @@ Dialog { if (opened) { app.activeDialogs.push(abstractdialog) } else { - app.activeDialogs.pop() + if (app.activeDialogs.indexOf(abstractdialog) < 0) { + console.log('dialog should exist in activeDialogs!') + app.activeDialogs.pop() + return + } + app.activeDialogs.splice(app.activeDialogs.indexOf(abstractdialog),1) } }