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(); } }