From dfa37b524496dcff80a077e78cbe04c150f8c694 Mon Sep 17 00:00:00 2001 From: Shishant Biswas Date: Sun, 27 Sep 2026 20:34:50 +0530 Subject: [PATCH] fix(ui): stale values in useSearch caused by ordering --- app/src/ui/hooks/use-search.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/ui/hooks/use-search.ts b/app/src/ui/hooks/use-search.ts index b17a6aef..9d088176 100644 --- a/app/src/ui/hooks/use-search.ts +++ b/app/src/ui/hooks/use-search.ts @@ -16,9 +16,8 @@ export function useSearch( const [location, navigate] = useLocation(); const defaults = useMemo(() => { return mergeObject( - // @ts-ignore - schema.template({ withOptional: true }), options?.defaultValue ?? {}, + schema.template({ withOptional: true }), ); }, [JSON.stringify({ schema, dflt: options?.defaultValue })]); const [value, setValue] = useState>(defaults);