From 8cb0d38d78a325b78063a2819b691b2ea7eec6d3 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 2 Nov 2022 10:11:50 +0100 Subject: [PATCH] Fix back button on subview (#14251) --- src/panels/lovelace/hui-root.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panels/lovelace/hui-root.ts b/src/panels/lovelace/hui-root.ts index e574a842f1..8867c59097 100644 --- a/src/panels/lovelace/hui-root.ts +++ b/src/panels/lovelace/hui-root.ts @@ -747,10 +747,10 @@ class HUIRoot extends LitElement { if (curViewConfig?.back_path) { navigate(curViewConfig.back_path); - } else if (history.length > 0) { + } else if (history.length > 1) { history.back(); } else { - navigate(views[0].path!); + navigate(this.route!.prefix); } }