mirror of
https://github.com/TeamPiped/Piped.git
synced 2026-09-15 17:23:45 +00:00
add search history
This commit is contained in:
@@ -101,7 +101,7 @@
|
||||
/>
|
||||
</div>
|
||||
<SearchSuggestions
|
||||
v-show="searchText && suggestionsVisible"
|
||||
v-show="(searchText || showSearchHistory) && suggestionsVisible"
|
||||
ref="searchSuggestions"
|
||||
:search-text="searchText"
|
||||
@searchchange="onSearchTextChange"
|
||||
@@ -137,6 +137,9 @@ export default {
|
||||
shouldShowTrending(_this) {
|
||||
return _this.getPreferenceString("homepage", "trending") != "trending";
|
||||
},
|
||||
showSearchHistory() {
|
||||
return localStorage.getItem("searchHistory") && localStorage.getItem("search_history");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// focus on search bar when Ctrl+k is pressed
|
||||
@@ -163,6 +166,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onInputFocus() {
|
||||
if (this.showSearchHistory) this.$refs.searchSuggestions.refreshSuggestions();
|
||||
this.suggestionsVisible = true;
|
||||
},
|
||||
onInputBlur() {
|
||||
|
||||
Reference in New Issue
Block a user