diff options
| author | Adam <[email protected]> | 2026-01-13 06:55:21 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-13 06:55:21 -0600 |
| commit | f3b7d2f7860aedec1a4c86511ed799d32474c32c (patch) | |
| tree | 0f3977736d05c010cfeb5f1d2db99c1f977bf4b6 /packages | |
| parent | 1facf7d8e41b2fcd98542f111df5c80fdf5af332 (diff) | |
| download | opencode-f3b7d2f7860aedec1a4c86511ed799d32474c32c.tar.gz opencode-f3b7d2f7860aedec1a4c86511ed799d32474c32c.zip | |
fix(app): file search
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/ui/src/hooks/use-filtered-list.tsx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index b6bd7d5c6..1b3be4b4c 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -22,18 +22,10 @@ export function useFilteredList<T>(props: FilteredListProps<T>) { const empty: Group[] = [] const [grouped, { refetch }] = createResource( - () => { - // When items is a function (not async filter function), call it to track changes - const itemsValue = - typeof props.items === "function" - ? (props.items as () => T[])() // Call synchronous function to track it - : props.items - - return { - filter: store.filter, - items: itemsValue, - } - }, + () => ({ + filter: store.filter, + items: typeof props.items === "function" ? undefined : props.items, + }), async ({ filter, items }) => { const needle = filter?.toLowerCase() const all = (items ?? (await (props.items as (filter: string) => T[] | Promise<T[]>)(needle))) || [] |
