mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Fix back button when directly opening subview (#16145)
This commit is contained in:
parent
2e7d973597
commit
178ad2dffa
@ -742,12 +742,14 @@ class HUIRoot extends LitElement {
|
|||||||
const curViewConfig =
|
const curViewConfig =
|
||||||
typeof this._curView === "number" ? views[this._curView] : undefined;
|
typeof this._curView === "number" ? views[this._curView] : undefined;
|
||||||
|
|
||||||
if (curViewConfig?.back_path) {
|
if (curViewConfig?.back_path != null) {
|
||||||
navigate(curViewConfig.back_path);
|
navigate(curViewConfig.back_path, { replace: true });
|
||||||
} else if (history.length > 1) {
|
} else if (history.length > 1) {
|
||||||
history.back();
|
history.back();
|
||||||
|
} else if (!views[0].subview) {
|
||||||
|
navigate(this.route!.prefix, { replace: true });
|
||||||
} else {
|
} else {
|
||||||
navigate(this.route!.prefix);
|
navigate("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user