Skip to content

Commit

Permalink
Merge pull request #398 from lamarios/fix/disable_search_suggestions_…
Browse files Browse the repository at this point in the history
…in_distraction_free_mode

remove search suggestions from distraction free mode
  • Loading branch information
lamarios authored Dec 6, 2023
2 parents 979b814 + e462559 commit 5073bd5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/search/states/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ class SearchCubit<T extends SearchState> extends Cubit<SearchState> {

void getSuggestions({bool hideResult = true}) {
emit(state.copyWith(showResults: !hideResult));
EasyDebounce.debounce('search-suggestions', const Duration(milliseconds: 500), () async {
var suggestions = (await service.getSearchSuggestion(state.queryController.value.text)).suggestions;
emit(state.copyWith(suggestions: suggestions));
});
if(!settings.state.distractionFreeMode) {
EasyDebounce.debounce('search-suggestions', const Duration(milliseconds: 500), () async {
var suggestions = (await service.getSearchSuggestion(state.queryController.value.text)).suggestions;
emit(state.copyWith(suggestions: suggestions));
});
}
}

List<String> getHistory() {
Expand Down

0 comments on commit 5073bd5

Please sign in to comment.