From ee6ca104e5eb1693b63901128ea315754f88f595 Mon Sep 17 00:00:00 2001 From: Filip <34747899+neriousy@users.noreply.github.com> Date: Wed, 14 Jan 2026 14:09:36 +0100 Subject: [PATCH] fix(app): file listing (#8309) --- packages/ui/src/hooks/use-filtered-list.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/hooks/use-filtered-list.tsx b/packages/ui/src/hooks/use-filtered-list.tsx index 26215e93c..b8a55000e 100644 --- a/packages/ui/src/hooks/use-filtered-list.tsx +++ b/packages/ui/src/hooks/use-filtered-list.tsx @@ -24,16 +24,12 @@ export function useFilteredList(props: FilteredListProps) { const [grouped, { refetch }] = createResource( () => ({ filter: store.filter, - items: - typeof props.items === "function" - ? props.items.length === 0 - ? (props.items as () => T[])() - : undefined - : props.items, + items: typeof props.items === "function" ? props.items(store.filter) : props.items, }), async ({ filter, items }) => { - const needle = filter?.toLowerCase() - const all = (items ?? (await (props.items as (filter: string) => T[] | Promise)(needle))) || [] + const query = filter ?? "" + const needle = query.toLowerCase() + const all = (await Promise.resolve(items)) || [] const result = pipe( all, (x) => {