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
```
pnpm serve
pnpm dev
```
You can now make changes and view then in realtime!

View File

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