瀏覽代碼

fix: router replace in Explore page (#4918)

tags/0.6.10
Nam Vu 1 年之前
父節點
當前提交
c212700341
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4
    2
      web/app/components/share/text-generation/index.tsx

+ 4
- 2
web/app/components/share/text-generation/index.tsx 查看文件

@@ -80,8 +80,10 @@ const TextGeneration: FC<IMainProps> = ({
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
}, [])


Loading…
取消
儲存