From 0f1485fa4ddaf7eb260dfa788f65236fc74b205d Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Tue, 17 Jan 2023 16:19:21 +0400 Subject: [PATCH] fix(AppMain): Open only one popup per component Close #9131 --- ui/app/mainui/AppMain.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ui/app/mainui/AppMain.qml b/ui/app/mainui/AppMain.qml index 73be2283223..53a596742f7 100644 --- a/ui/app/mainui/AppMain.qml +++ b/ui/app/mainui/AppMain.qml @@ -52,6 +52,8 @@ Item { // set from main.qml property var sysPalette + property var activePopupComponents: [] + signal closeProfilePopup() Connections { @@ -158,8 +160,21 @@ Item { onOpenEditDisplayNamePopup: Global.openPopup(displayNamePopupComponent) onOpenPopupRequested: { + if (activePopupComponents.includes(popupComponent)) { + return; + } + const popup = popupComponent.createObject(appMain, params); popup.open(); + + activePopupComponents.push(popupComponent); + + popup.closed.connect(() => { + const removeIndex = activePopupComponents.indexOf(popupComponent); + if (removeIndex !== -1) { + activePopupComponents.splice(removeIndex, 1); + } + }) return popup; }