From 45e763ea0ae95e1e13a3973a180b8fbf54c58dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Obermu=CC=88ller?= Date: Wed, 8 Nov 2023 14:33:38 +0000 Subject: [PATCH] add debounce --- frontend/src/lib/components/CommandBar/searchBarLogic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/CommandBar/searchBarLogic.ts b/frontend/src/lib/components/CommandBar/searchBarLogic.ts index 2b0d195b7e11d..e4f5a72e8e3a8 100644 --- a/frontend/src/lib/components/CommandBar/searchBarLogic.ts +++ b/frontend/src/lib/components/CommandBar/searchBarLogic.ts @@ -29,7 +29,8 @@ export const searchBarLogic = kea([ searchResponse: [ null as SearchResponse | null, { - setSearchQuery: async ({ query }) => { + setSearchQuery: async ({ query }, breakpoint) => { + await breakpoint(300) return await api.get(`api/projects/@current/search?q=${query}`) }, },