Xinyang Yu
2024-01-25 d90199c8dbb2028cbe1f22997ab1cb0c26022916
quartz/components/scripts/explorer.inline.ts
@@ -59,8 +59,7 @@
  // Save folder state to localStorage
  const clickFolderPath = currentFolderParent.dataset.folderpath as string
  // Remove leading "/"
  const fullFolderPath = clickFolderPath.substring(1)
  const fullFolderPath = clickFolderPath
  toggleCollapsedByPath(explorerState, fullFolderPath)
  const stringifiedFileTree = JSON.stringify(explorerState)
@@ -108,9 +107,7 @@
    explorerState = JSON.parse(storageTree)
    explorerState.map((folderUl) => {
      // grab <li> element for matching folder path
      const folderLi = document.querySelector(
        `[data-folderpath='/${folderUl.path}']`,
      ) as HTMLElement
      const folderLi = document.querySelector(`[data-folderpath='${folderUl.path}']`) as HTMLElement
      // Get corresponding content <ul> tag and set state
      if (folderLi) {