From 2caa87d35d162941cc3d372122aee31cd023b707 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 5 Dec 2024 02:09:06 +1100 Subject: [PATCH] Prevent interface crash from dialog abuse (#1789) - Adds hard-coded limit of 10 open dialogs - Discards the oldest item on the dialog stack to maintain size --- src/stores/dialogStore.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stores/dialogStore.ts b/src/stores/dialogStore.ts index 75de22242..db982eadc 100644 --- a/src/stores/dialogStore.ts +++ b/src/stores/dialogStore.ts @@ -57,6 +57,10 @@ export const useDialogStore = defineStore('dialog', () => { props?: Record dialogComponentProps?: DialogComponentProps }) { + if (dialogStack.value.length >= 10) { + dialogStack.value.shift() + } + const dialog = { key: options.key, visible: true,