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
This commit is contained in:
filtered
2024-12-05 02:09:06 +11:00
committed by GitHub
parent dabcd4741b
commit 2caa87d35d

View File

@@ -57,6 +57,10 @@ export const useDialogStore = defineStore('dialog', () => {
props?: Record<string, any>
dialogComponentProps?: DialogComponentProps
}) {
if (dialogStack.value.length >= 10) {
dialogStack.value.shift()
}
const dialog = {
key: options.key,
visible: true,