close all dialogs on navigate

This commit is contained in:
Petar Petrov
2024-12-11 13:35:09 +02:00
parent 142e674020
commit c713106948
2 changed files with 34 additions and 25 deletions

View File

@@ -174,6 +174,9 @@ export const closeLastDialog = async () => {
}
};
export const closeAllDialogs = () =>
Promise.all(OPEN_DIALOG_STACK.map((state) => closeDialog(state.dialogTag)));
const _handleClosed = async (ev: HASSDomEvent<DialogClosedParams>) => {
// If not closed by navigating back, remove the open state from history
const dialogIndex = OPEN_DIALOG_STACK.findIndex(