forked from github/quartz
fix(explorer): prevent tree duplication when rapidly navigating
This commit is contained in:
1 parent
52a5196f38
commit
08b2228a43
1 file changed
+3
@@ -263,6 +263,9 @@ document.addEventListener("prenav", async () => {
|
|||||||
const explorer = document.querySelector(".explorer-ul")
|
const explorer = document.querySelector(".explorer-ul")
|
||||||
if (!explorer) return
|
if (!explorer) return
|
||||||
sessionStorage.setItem("explorerScrollTop", explorer.scrollTop.toString())
|
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"]) => {
|
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
||||||
|
|||||||
Reference in new issue
Block a user