fix hashtag disappearing in u query params

This commit is contained in:
Kalle (Sendou) 2020-12-10 15:27:28 +02:00
parent 2f58b261bc
commit 70bbb05bf2

View File

@ -37,7 +37,13 @@ const UserSearchPage = ({ users }: Props) => {
if (debouncedFilter.length < 3) {
router.push(`/u`, undefined, { shallow: true });
} else {
router.push(`/u?filter=${debouncedFilter}`, undefined, { shallow: true });
router.push(
`/u?filter=${encodeURIComponent(debouncedFilter)}`,
undefined,
{
shallow: true,
}
);
}
}, [debouncedFilter]);