From 609016eec0bb446269cd8428bcdf84dc40d86c92 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 23 Jul 2023 05:48:03 +0530 Subject: [PATCH] Potential fix to the search menu --- src/routes/SearchMenu.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/routes/SearchMenu.vue b/src/routes/SearchMenu.vue index 4c796ed..930ed8f 100644 --- a/src/routes/SearchMenu.vue +++ b/src/routes/SearchMenu.vue @@ -37,11 +37,7 @@ export default { } }, watch: { - searchText (val) { - if (val && val !== this.select) { - this.refreshSuggestions() - } - }, + searchText: 'refreshSuggestions', async select (val) { if (val === '') { @@ -63,16 +59,23 @@ export default { }, computed: { searchSuggestions () { + /* if (this.searchText.length === 0) { return this.actualSuggestions } else { return [this.searchText].concat(this.actualSuggestions) } + */ + return [this.searchText].concat(this.actualSuggestions) } }, methods: { refreshSuggestions: _debounce(async function refreshSuggestions () { + if (this.searchText.length === 0) { + return + } + this.requestInProgress = true const suggestions = await this.$store.dispatch('auth/makeRequest', { path: '/suggestions',