aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-11-14 09:47:42 +0000
committerGitHub <noreply@github.com>2025-11-14 09:47:42 +0000
commit07390aeff9fb70499e57b236c76419cf884ef4cc (patch)
treed0657db81aba1ccd29ce3fb9bd5c3f1735189fcb /apps
parentc34f70dace47e8a0fb97a3565fb2af626861e898 (diff)
downloadkarakeep-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')
-rw-r--r--apps/mobile/app/dashboard/search.tsx2
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);