Просмотр исходного кода

fix(desktop): file loading errors

Adam 2 месяцев назад
Родитель
Сommit
1bce898ca7
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/desktop/src/context/local.tsx

+ 2 - 2
packages/desktop/src/context/local.tsx

@@ -360,7 +360,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
       const init = async (path: string) => {
       const init = async (path: string) => {
         const relativePath = relative(path)
         const relativePath = relative(path)
         if (!store.node[relativePath]) await fetch(path)
         if (!store.node[relativePath]) await fetch(path)
-        if (store.node[relativePath].loaded) return
+        if (store.node[relativePath]?.loaded) return
         return load(relativePath)
         return load(relativePath)
       }
       }
 
 
@@ -380,7 +380,7 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
         context.addActive()
         context.addActive()
         if (options?.pinned) setStore("node", path, "pinned", true)
         if (options?.pinned) setStore("node", path, "pinned", true)
         if (options?.view && store.node[relativePath].view === undefined) setStore("node", path, "view", options.view)
         if (options?.view && store.node[relativePath].view === undefined) setStore("node", path, "view", options.view)
-        if (store.node[relativePath].loaded) return
+        if (store.node[relativePath]?.loaded) return
         return load(relativePath)
         return load(relativePath)
       }
       }