Ensure saved search history does not appear when disabled.

This commit is contained in:
Kavin 2022-10-02 14:27:25 +01:00
parent f920a1aae8
commit 5af767decb
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@ export default {
},
async refreshSuggestions() {
if (!this.searchText) {
this.searchSuggestions = JSON.parse(localStorage.getItem("search_history")) ?? [];
if (this.getPreferenceBoolean("searchHistory", false))
this.searchSuggestions = JSON.parse(localStorage.getItem("search_history")) ?? [];
} else {
this.searchSuggestions = (
await this.fetchJson(this.apiUrl() + "/opensearch/suggestions", {