Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: router replace in Explore page (#4918)

Nam Vuc21270034189
diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx
index 21ff2b051ae..79690275dd9 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<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
}, [])