mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 18:36:23 +02:00
fix: auto-dismiss overlay when no suggestions are available
This commit is contained in:
parent
70807cccd1
commit
5439b3991b
1 changed files with 8 additions and 0 deletions
|
|
@ -97,6 +97,14 @@ export default function SuggestionPage() {
|
|||
return () => clearTimeout(timer);
|
||||
}, [error, api]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading || error || options.length > 0) return;
|
||||
const timer = setTimeout(() => {
|
||||
api?.dismissSuggestion?.();
|
||||
}, AUTO_DISMISS_MS);
|
||||
return () => clearTimeout(timer);
|
||||
}, [isLoading, error, options, api]);
|
||||
|
||||
const fetchSuggestion = useCallback(
|
||||
async (screenshot: string, searchSpaceId: string, appName?: string, windowTitle?: string) => {
|
||||
abortRef.current?.abort();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue