fix(explorer): prevent tree duplication when rapidly navigating
This commit is contained in:
@@ -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