fix(appmain): Fix multiple creations of mailservers-not-working popup

Closes: #5899
This commit is contained in:
Boris Melnik 2022-06-01 17:49:57 +03:00
parent 326147c549
commit 17cbd4512d
1 changed files with 6 additions and 2 deletions

View File

@ -640,10 +640,13 @@ Item {
Connections { Connections {
target: rootStore.mainModuleInst target: rootStore.mainModuleInst
onMailserverNotWorking: { onMailserverNotWorking: {
Global.openPopup(mailserverNotWorkingPopupComponent); if (!appLayout.mailserverNotWorkingPopup) {
appLayout.mailserverNotWorkingPopup = Global.openPopup(mailserverNotWorkingPopupComponent);
}
} }
} }
} } // ColumnLayout
property var mailserverNotWorkingPopup: null
Component { Component {
id: mailserverNotWorkingPopupComponent id: mailserverNotWorkingPopupComponent
@ -652,6 +655,7 @@ Item {
anchors.centerIn: parent anchors.centerIn: parent
header.title: qsTr("Can not connect to mailserver") header.title: qsTr("Can not connect to mailserver")
onClosed: { onClosed: {
appLayout.mailserverNotWorkingPopup = null
destroy() destroy()
} }