diff options
| author | adamelmore <[email protected]> | 2026-01-27 16:13:00 -0600 |
|---|---|---|
| committer | adamelmore <[email protected]> | 2026-01-27 16:13:11 -0600 |
| commit | d17ba84ee1e55093ff33f0ac512cbb00030c21e7 (patch) | |
| tree | fa0fb5a12748e44a4cb9f7b5854036db60e2d4c4 /packages/app/src/components | |
| parent | 5c8580a187d437f2813a9cc315ab04db5acf7ad1 (diff) | |
| download | opencode-d17ba84ee1e55093ff33f0ac512cbb00030c21e7.tar.gz opencode-d17ba84ee1e55093ff33f0ac512cbb00030c21e7.zip | |
fix(app): file tree not always loading
Diffstat (limited to 'packages/app/src/components')
| -rw-r--r-- | packages/app/src/components/file-tree.tsx | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/packages/app/src/components/file-tree.tsx b/packages/app/src/components/file-tree.tsx index bd989f755..d43310b19 100644 --- a/packages/app/src/components/file-tree.tsx +++ b/packages/app/src/components/file-tree.tsx @@ -8,7 +8,6 @@ import { createMemo, For, Match, - onCleanup, Show, splitProps, Switch, @@ -124,28 +123,7 @@ export default function FileTree(props: { createEffect(() => { const path = props.path - const state = { cancelled: false, timer: undefined as number | undefined } - - const load = (attempt: number) => { - if (state.cancelled) return - if (file.tree.state(path)?.loaded) return - - void untrack(() => file.tree.list(path)).finally(() => { - if (state.cancelled) return - if (file.tree.state(path)?.loaded) return - if (attempt >= 2) return - - const wait = Math.min(2000, 250 * 2 ** attempt) - state.timer = window.setTimeout(() => load(attempt + 1), wait) - }) - } - - load(0) - - onCleanup(() => { - state.cancelled = true - if (state.timer !== undefined) clearTimeout(state.timer) - }) + untrack(() => void file.tree.list(path)) }) const nodes = createMemo(() => { |
