mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
log warning when navigation is blocked
This commit is contained in:
parent
c713106948
commit
48f5d17060
@ -21,8 +21,9 @@ export const navigate = async (path: string, options?: NavigateOptions) => {
|
||||
if (history.state?.dialog) {
|
||||
const closed = await closeAllDialogs();
|
||||
if (!closed) {
|
||||
// block navigation if dialogs refuse to close
|
||||
return;
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("Navigation blocked, because dialog refused to close");
|
||||
return false;
|
||||
}
|
||||
// if there were open dialogs, we discard the current state
|
||||
replace = true;
|
||||
@ -50,4 +51,5 @@ export const navigate = async (path: string, options?: NavigateOptions) => {
|
||||
fireEvent(mainWindow, "location-changed", {
|
||||
replace,
|
||||
});
|
||||
return true;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user