summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/context/local.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/app/src/context/local.tsx')
-rw-r--r--packages/app/src/context/local.tsx25
1 files changed, 14 insertions, 11 deletions
diff --git a/packages/app/src/context/local.tsx b/packages/app/src/context/local.tsx
index 600a0e4b1..49217b82b 100644
--- a/packages/app/src/context/local.tsx
+++ b/packages/app/src/context/local.tsx
@@ -377,17 +377,20 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
}
const list = async (path: string) => {
- return sdk.client.file.list({ path: path + "/" }).then((x) => {
- setStore(
- "node",
- produce((draft) => {
- x.data!.forEach((node) => {
- if (node.path in draft) return
- draft[node.path] = node
- })
- }),
- )
- })
+ return sdk.client.file
+ .list({ path: path + "/" })
+ .then((x) => {
+ setStore(
+ "node",
+ produce((draft) => {
+ x.data!.forEach((node) => {
+ if (node.path in draft) return
+ draft[node.path] = node
+ })
+ }),
+ )
+ })
+ .catch(() => {})
}
const searchFiles = (query: string) => sdk.client.find.files({ query, dirs: "false" }).then((x) => x.data!)