« get me outta code hell

client: sidebar-search: never search an empty query - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-02-12 06:38:23 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-02-12 08:04:26 -0400
commit7ef5f9beabca4df63eec49e37888d78e2a064c07 (patch)
treeeb64f6eb5a1a524e9ee792be56cb255d1e0ec413 /src
parent1f7da6f472a2bd12bd899f590e039972debeee7c (diff)
client: sidebar-search: never search an empty query
Some code paths knida just take us here no matter what's
actually entered into the input, so it's easiest to just
dismiss empty queries every time.
Diffstat (limited to 'src')
-rw-r--r--src/static/js/client/sidebar-search.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js
index c79fb837..60de5bc4 100644
--- a/src/static/js/client/sidebar-search.js
+++ b/src/static/js/client/sidebar-search.js
@@ -476,6 +476,10 @@ function trackSidebarSearchDownloadEnds(event) {
 async function activateSidebarSearch(query) {
   const {session, state} = info;
 
+  if (!query) {
+    return;
+  }
+
   if (state.stoppedTypingTimeout) {
     clearTimeout(state.stoppedTypingTimeout);
     state.stoppedTypingTimeout = null;