fix(@desktop/keycard): crash by just running "Setup a new Keycard with an existing account" flow and closing it

Fixes: #11346
This commit is contained in:
Sale Djenic 2023-06-30 11:24:08 +02:00 committed by saledjenic
parent db16c61cbe
commit 263ef86c31
2 changed files with 18 additions and 9 deletions

View File

@ -94,22 +94,27 @@ SettingsContentBase {
target: root.keycardStore.keycardModule target: root.keycardStore.keycardModule
function onDisplayKeycardSharedModuleFlow() { function onDisplayKeycardSharedModuleFlow() {
Global.openPopup(keycardPopup); keycardPopup.active = true
} }
function onDestroyKeycardSharedModuleFlow() { function onDestroyKeycardSharedModuleFlow() {
Global.closePopup(); keycardPopup.active = false
} }
function onSharedModuleBusy() { function onSharedModuleBusy() {
Global.openPopup(sharedModuleBusyPopupComponent) Global.openPopup(sharedModuleBusyPopupComponent)
} }
} }
Component { Loader {
id: keycardPopup id: keycardPopup
KeycardPopup { active: false
sourceComponent: KeycardPopup {
sharedKeycardModule: root.keycardStore.keycardModule.keycardSharedModule sharedKeycardModule: root.keycardStore.keycardModule.keycardSharedModule
emojiPopup: root.emojiPopup emojiPopup: root.emojiPopup
} }
onLoaded: {
keycardPopup.item.open()
}
} }
} }
} }

View File

@ -72,11 +72,11 @@ Item {
} }
function onDisplayKeycardSharedModuleFlow() { function onDisplayKeycardSharedModuleFlow() {
Global.openPopup(keycardPopup); keycardPopup.active = true
} }
function onDestroyKeycardSharedModuleFlow() { function onDestroyKeycardSharedModuleFlow() {
Global.closePopup(); keycardPopup.active = false
} }
function onMailserverWorking() { function onMailserverWorking() {
@ -1427,12 +1427,16 @@ Item {
Global.settingsLoaded() Global.settingsLoaded()
} }
Component { Loader {
id: keycardPopup id: keycardPopup
KeycardPopup { active: false
anchors.centerIn: parent sourceComponent: KeycardPopup {
sharedKeycardModule: appMain.rootStore.mainModuleInst.keycardSharedModule sharedKeycardModule: appMain.rootStore.mainModuleInst.keycardSharedModule
} }
onLoaded: {
keycardPopup.item.open()
}
} }
DropAreaPanel { DropAreaPanel {