From 26c148167b174c987ad23568d8bed6301f944078 Mon Sep 17 00:00:00 2001 From: Mayank Chhabra Date: Thu, 22 Sep 2022 19:30:00 +0700 Subject: [PATCH] Fix bug in search causing console errors (#38) --- src/store/modules/apps.js | 6 ++++++ src/views/AppStore/AppStore.vue | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/store/modules/apps.js b/src/store/modules/apps.js index bdf5da15..64eca587 100644 --- a/src/store/modules/apps.js +++ b/src/store/modules/apps.js @@ -104,6 +104,12 @@ const actions = { searchAppStore({ state, commit }, searchQuery) { commit("setSearchQuery", searchQuery); + // don't try to search for no query, eg. when + // the user clears the search input + if (!searchQuery) { + return; + } + // don't search if the search index isn't built yet if (!state.searchIndex) { return commit("setSearchResults", []); diff --git a/src/views/AppStore/AppStore.vue b/src/views/AppStore/AppStore.vue index 42a002de..f8d7f553 100644 --- a/src/views/AppStore/AppStore.vue +++ b/src/views/AppStore/AppStore.vue @@ -21,7 +21,6 @@ class="search-input" type="text" v-model="appStoreSearchQuery" - @input="search" placeholder="Search apps" >