check if listened before adding queries

This commit is contained in:
Fabian Freund
2025-09-29 11:02:14 +02:00
parent 81f04c2078
commit bb77f8c015
7 changed files with 45 additions and 27 deletions
@@ -62,9 +62,11 @@ class SiteSearch extends HookConsumerWidget {
final searchFocusNode = useFocusNode();
useListenableCallback(searchTextController, () {
ref
.read(searchSuggestionsProvider().notifier)
.addQuery(searchTextController.text);
if (ref.exists(searchSuggestionsProvider())) {
ref
.read(searchSuggestionsProvider().notifier)
.addQuery(searchTextController.text);
}
});
final selectedBang = ref.watch(selectedBangDataProvider(domain: domain));