From e59f9106cc8a84820fc564226ca0ac64116a0d48 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Sun, 18 Jun 2023 13:35:04 -0700 Subject: [PATCH] fix: fixes route update with hash --- assets/components/LogViewer/LogViewer.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/components/LogViewer/LogViewer.vue b/assets/components/LogViewer/LogViewer.vue index a0abd01f..52384204 100644 --- a/assets/components/LogViewer/LogViewer.vue +++ b/assets/components/LogViewer/LogViewer.vue @@ -58,7 +58,9 @@ const routeHash = useRouteHash(); watch( routeHash, (hash) => { - document.querySelector(`[data-key="${hash.substring(1)}"]`)?.scrollIntoView({ block: "center" }); + if(hash){ + document.querySelector(`[data-key="${hash.substring(1)}"]`)?.scrollIntoView({ block: "center" }); + } }, { immediate: true, flush: "post" } );