From 18cce45b88a3092c6e25ba9887c3093c0f7efccc Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 11 Dec 2024 23:47:23 +0200 Subject: [PATCH] Fix for auto closing dialogs on `navigate` (#23262) --- src/dialogs/make-dialog-manager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dialogs/make-dialog-manager.ts b/src/dialogs/make-dialog-manager.ts index 0b18fc77da9f..1dbc51be5858 100644 --- a/src/dialogs/make-dialog-manager.ts +++ b/src/dialogs/make-dialog-manager.ts @@ -202,7 +202,8 @@ const _handleClosed = async (ev: HASSDomEvent) => { { dialog: OPEN_DIALOG_STACK[OPEN_DIALOG_STACK.length - 1].dialogTag }, "" ); - } else { + } else if (dialogIndex !== -1) { + // if the dialog is the last one and it was indeed open, go back mainWindow.history.back(); } }