Don't submit empty search queries

This commit is contained in:
JP 2022-01-28 18:29:46 -05:00 committed by GitHub
parent d0d2d4d1e3
commit 2d37df6f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ export default function Search () {
}}
className={`w-auto ${styles.active}`}
onSubmit={async ({ q }) => {
router.push(`/search?q=${q}`)
if (q != '') {
router.push(`/search?q=${q}`)
}
}}
>
<Input