Merge pull request #3420 from grittypuffy/fix-search

fix: Infinite loading when search query is empty
This commit is contained in:
Bnyro 2024-02-23 17:38:18 +01:00 committed by GitHub
commit 1059a5967b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 5 deletions

View file

@ -113,7 +113,7 @@ pnpm install
### Compiles and hot-reloads for development ### Compiles and hot-reloads for development
``` ```
pnpm serve pnpm dev
``` ```
You can now make changes and view then in realtime! You can now make changes and view then in realtime!

View file

@ -200,10 +200,14 @@ export default {
}, },
submitSearch(e) { submitSearch(e) {
e.target.blur(); e.target.blur();
this.$router.push({ if (this.searchText) {
name: "SearchResults", this.$router.push({
query: { search_query: this.searchText }, name: "SearchResults",
}); query: { search_query: this.searchText },
});
} else {
this.$router.push("/");
}
return; return;
}, },
}, },