fix(explorer): prevent tree duplication when rapidly navigating

This commit is contained in:
Emile Bangma
2025-06-19 19:45:25 +00:00
committed by GitHub
parent 52a5196f38
commit 08b2228a43

View File

@@ -263,6 +263,9 @@ document.addEventListener("prenav", async () => {
const explorer = document.querySelector(".explorer-ul")
if (!explorer) return
sessionStorage.setItem("explorerScrollTop", explorer.scrollTop.toString())
if (!currentExplorerState) return
const stringifiedFileTree = JSON.stringify(currentExplorerState)
localStorage.setItem("fileTree", stringifiedFileTree)
})
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {