diff --git a/app/components/layout/GlobalSearch.tsx b/app/components/layout/GlobalSearch.tsx index 81805f49e..496d3ab00 100644 --- a/app/components/layout/GlobalSearch.tsx +++ b/app/components/layout/GlobalSearch.tsx @@ -231,7 +231,10 @@ function GlobalSearchContent({ ); const hasQuery = query.length >= 3; + const fetchedQuery = fetcher.data?.query ?? null; const fetchedType = fetcher.data?.type ?? null; + const isCurrentFetch = + hasQuery && fetchedQuery === query && fetchedType === searchType; const results = hasQuery && fetchedType === searchType ? (fetcher.data?.results ?? []) : []; @@ -388,15 +391,27 @@ function GlobalSearchContent({ className={clsx(styles.listBox, "scrollbar")} aria-label={t("common:search")} onAction={handleSelect} - renderEmptyState={() => - hasQuery ? ( + renderEmptyState={() => { + if (!hasQuery) { + return ( +