| const pathname = usePathname() | const pathname = usePathname() | ||||
| useEffect(() => { | useEffect(() => { | ||||
| const params = new URLSearchParams(searchParams) | const params = new URLSearchParams(searchParams) | ||||
| params.delete('mode') | |||||
| router.replace(`${pathname}?${params.toString()}`) | |||||
| if (params.has('mode')) { | |||||
| params.delete('mode') | |||||
| router.replace(`${pathname}?${params.toString()}`) | |||||
| } | |||||
| // eslint-disable-next-line react-hooks/exhaustive-deps | // eslint-disable-next-line react-hooks/exhaustive-deps | ||||
| }, []) | }, []) | ||||