fix: router replace in Explore page (#4918)
This commit is contained in:
@@ -80,8 +80,10 @@ const TextGeneration: FC<IMainProps> = ({
|
|||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const params = new URLSearchParams(searchParams)
|
const params = new URLSearchParams(searchParams)
|
||||||
params.delete('mode')
|
if (params.has('mode')) {
|
||||||
router.replace(`${pathname}?${params.toString()}`)
|
params.delete('mode')
|
||||||
|
router.replace(`${pathname}?${params.toString()}`)
|
||||||
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user