From faf3488b1ea00d97386477017248430c7c020dab Mon Sep 17 00:00:00 2001 From: Peace Date: Sat, 28 Jan 2023 14:15:25 +0100 Subject: [PATCH] fix: unfold tree if monitor is accessed directly --- src/components/MonitorListItem.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/MonitorListItem.vue b/src/components/MonitorListItem.vue index d62d9158f..58e3e78b5 100644 --- a/src/components/MonitorListItem.vue +++ b/src/components/MonitorListItem.vue @@ -117,7 +117,12 @@ export default { } }, beforeMount() { - // this.isCollapsed = localStorage.getItem(`monitor_${this.monitor.id}_collapsed`) === "true"; + + // Always unfold if monitor is accessed directly + if (this.monitor.childrenIDs.includes(parseInt(this.$route.params.id))) { + this.isCollapsed = false; + return; + } let storage = window.localStorage.getItem("monitorCollapsed"); if (storage === null) {