diff options
| author | Mohamed Bassem <me@mbassem.com> | 2025-11-14 09:47:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-14 09:47:42 +0000 |
| commit | 07390aeff9fb70499e57b236c76419cf884ef4cc (patch) | |
| tree | d0657db81aba1ccd29ce3fb9bd5c3f1735189fcb /apps/mobile | |
| parent | c34f70dace47e8a0fb97a3565fb2af626861e898 (diff) | |
| download | karakeep-07390aeff9fb70499e57b236c76419cf884ef4cc.tar.zst | |
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 <noreply@anthropic.com>
Diffstat (limited to 'apps/mobile')
| -rw-r--r-- | apps/mobile/app/dashboard/search.tsx | 2 |
1 files changed, 1 insertions, 1 deletions
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<TextInput>(null); const [isInputFocused, setIsInputFocused] = useState(true); |
