diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx index 21ff2b051a..79690275dd 100644 --- a/web/app/components/share/text-generation/index.tsx +++ b/web/app/components/share/text-generation/index.tsx @@ -80,8 +80,10 @@ const TextGeneration: FC = ({ const pathname = usePathname() useEffect(() => { 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 }, [])