From da3052958546149982e282e0bd2836452d66c4fa Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 20 Sep 2025 14:17:08 +0800 Subject: [PATCH] Change AsyncSelect to load search history on initial mount - Use empty query for initial load - Remove value dependency from effect - Always show search history first - Simplify initialization logic --- lightrag_webui/src/components/ui/AsyncSelect.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightrag_webui/src/components/ui/AsyncSelect.tsx b/lightrag_webui/src/components/ui/AsyncSelect.tsx index 4b88c1c9..879237dd 100644 --- a/lightrag_webui/src/components/ui/AsyncSelect.tsx +++ b/lightrag_webui/src/components/ui/AsyncSelect.tsx @@ -133,8 +133,8 @@ export function AsyncSelect({ try { setLoading(true) setError(null) - // If we have a value, use it for the initial search - const data = await fetcher(value) + // Always use empty query for initial load to show search history + const data = await fetcher('') setOriginalOptions(data) setOptions(data) } catch (err) { @@ -147,7 +147,7 @@ export function AsyncSelect({ if (!mounted) { initializeOptions() } - }, [mounted, fetcher, value]) + }, [mounted, fetcher]) useEffect(() => { const fetchOptions = async () => {