mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-04-03 06:16:59 +00:00
Option to disable search suggestions
This commit is contained in:
@@ -50,13 +50,16 @@ export default {
|
||||
if (!this.searchText) {
|
||||
if (this.getPreferenceBoolean("searchHistory", false))
|
||||
this.searchSuggestions = JSON.parse(localStorage.getItem("search_history")) ?? [];
|
||||
} else {
|
||||
} else if (this.getPreferenceBoolean("searchSuggestions", true)) {
|
||||
this.searchSuggestions =
|
||||
(
|
||||
await this.fetchJson(this.apiUrl() + "/opensearch/suggestions", {
|
||||
query: this.searchText,
|
||||
})
|
||||
)?.[1] ?? [];
|
||||
} else {
|
||||
this.searchSuggestions = [];
|
||||
return;
|
||||
}
|
||||
this.searchSuggestions.unshift(this.searchText);
|
||||
this.setSelected(0);
|
||||
|
||||
Reference in New Issue
Block a user