mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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 =
|
||||
typeof this._curView === "number" ? views[this._curView] : undefined;
|
||||
|
||||
if (curViewConfig?.back_path) {
|
||||
navigate(curViewConfig.back_path);
|
||||
if (curViewConfig?.back_path != null) {
|
||||
navigate(curViewConfig.back_path, { replace: true });
|
||||
} else if (history.length > 1) {
|
||||
history.back();
|
||||
} else if (!views[0].subview) {
|
||||
navigate(this.route!.prefix, { replace: true });
|
||||
} else {
|
||||
navigate(this.route!.prefix);
|
||||
navigate("/");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user