diff --git a/packages/frontend/src/components/MkFolderPage.vue b/packages/frontend/src/components/MkFolderPage.vue index 37cd4a749e..33816ba8c1 100644 --- a/packages/frontend/src/components/MkFolderPage.vue +++ b/packages/frontend/src/components/MkFolderPage.vue @@ -65,7 +65,8 @@ function popstateHandler(): void { onMounted(() => { // Push a new history state with a unique hash when the folder page opens - window.history.pushState(null, '', `#folder-${props.pageId}`); + const folderHash = `#folder-${props.pageId}`; + window.history.pushState(null, '', folderHash); // Listen for popstate events (browser back button) window.addEventListener('popstate', popstateHandler);