Skip to content

Commit

Permalink
trim query to prevent redundant search on empty query
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed May 2, 2024
1 parent b2f963e commit 23fe064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Panels/Common/ToolSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ watch(
function checkQuery(q: string) {
emit("onQuery", q);
if (q && q.length >= MIN_QUERY_LENGTH) {
if (q.trim() && q.trim().length >= MIN_QUERY_LENGTH) {
if (FAVORITES.includes(q)) {
post({ type: "favoriteTools" });
} else {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Panels/ToolBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const propShowAdvanced = computed({
});
const query = computed({
get: () => {
return props.panelQuery;
return props.panelQuery.trim();
},
set: (q: string) => {
queryPending.value = true;
Expand Down

0 comments on commit 23fe064

Please sign in to comment.