From 5af767decb52b10b06b440768fd8f1a21986c1ac Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 2 Oct 2022 14:27:25 +0100 Subject: [PATCH] Ensure saved search history does not appear when disabled. --- src/components/SearchSuggestions.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SearchSuggestions.vue b/src/components/SearchSuggestions.vue index a110b9f7..2b5f9d80 100644 --- a/src/components/SearchSuggestions.vue +++ b/src/components/SearchSuggestions.vue @@ -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", {