feat: notifications (#1947)
* feat: notifications * feat: watchers * improvements * handle page move for watchers * make watchers non-blocking * more
This commit is contained in:
@@ -44,8 +44,8 @@ export function SearchMobileControl({ onSearch }: SearchMobileControlProps) {
|
||||
return (
|
||||
<Tooltip label={t("Search")} withArrow>
|
||||
<ActionIcon
|
||||
variant="default"
|
||||
style={{ border: "none" }}
|
||||
variant="subtle"
|
||||
color="dark"
|
||||
onClick={onSearch}
|
||||
size="sm"
|
||||
>
|
||||
|
||||
@@ -24,13 +24,14 @@ export function usePageSearchQuery(
|
||||
}
|
||||
|
||||
export function useSearchSuggestionsQuery(
|
||||
params: SearchSuggestionParams,
|
||||
params: SearchSuggestionParams & { preload?: boolean },
|
||||
): UseQueryResult<ISuggestionResult, Error> {
|
||||
const { preload, ...queryParams } = params;
|
||||
return useQuery({
|
||||
queryKey: ["search-suggestion", params.query],
|
||||
staleTime: 60 * 1000, // 1min
|
||||
queryFn: () => searchSuggestions(params),
|
||||
enabled: !!params.query,
|
||||
queryFn: () => searchSuggestions(queryParams),
|
||||
enabled: preload || !!params.query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user