From 07390aeff9fb70499e57b236c76419cf884ef4cc Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Fri, 14 Nov 2025 09:47:42 +0000 Subject: fix: remove incorrect array destructuring in mobile search (#2124) The search was crashing because of incorrect array destructuring on the useDebounce hook return value. useDebounce returns a string, not an array, so using `const [query] = useDebounce(...)` caused query to be undefined when the search string was empty. This resulted in passing { text: undefined } to the tRPC endpoint, which failed Zod validation expecting a string. Fixed by removing the array destructuring: const query = useDebounce(...) Co-authored-by: Claude --- apps/mobile/app/dashboard/search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/mobile/app/dashboard/search.tsx b/apps/mobile/app/dashboard/search.tsx index 5fababc3..ab89ce8d 100644 --- a/apps/mobile/app/dashboard/search.tsx +++ b/apps/mobile/app/dashboard/search.tsx @@ -19,7 +19,7 @@ const MAX_DISPLAY_SUGGESTIONS = 5; export default function Search() { const [search, setSearch] = useState(""); - const [query] = useDebounce(search, 10); + const query = useDebounce(search, 10); const inputRef = useRef(null); const [isInputFocused, setIsInputFocused] = useState(true); -- cgit v1.2.3-70-g09d2