From 0d0665ca7c8cd6849ba827fed5eea82c9ab059cd Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 22 Sep 2024 01:40:52 +0200 Subject: [PATCH] [UI] Keep track of the number of stack modals. --- platypush/backend/http/webapp/src/App.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/webapp/src/App.vue b/platypush/backend/http/webapp/src/App.vue index bbeea48a9b..a1675aa330 100644 --- a/platypush/backend/http/webapp/src/App.vue +++ b/platypush/backend/http/webapp/src/App.vue @@ -56,6 +56,7 @@ export default { pwaInstallEvent: null, initialized: false, initError: null, + stackedModals: 0, } }, @@ -83,7 +84,7 @@ export default { methods: { onNotification(notification) { - this.$refs.notifications.create(notification) + this.$refs.notifications?.create(notification) }, async initConfig() { @@ -100,7 +101,15 @@ export default { this.pwaInstallEvent.prompt() this.$refs.pwaDialog.close() - } + }, + + onModalClose() { + this.stackedModals = Math.max(0, this.stackedModals - 1) + }, + + onModalOpen() { + this.stackedModals++ + }, }, async created() { @@ -136,6 +145,8 @@ export default { bus.onNotification(this.onNotification) bus.on('connect', () => this.connected = true) bus.on('disconnect', () => this.connected = false) + bus.on('modal-open', this.onModalOpen) + bus.on('modal-close', this.onModalClose) }, }