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.

chore: remove useless tag params logic in use effect (#38269)

Joelc1d03a888fcd
diff --git a/web/app/components/apps/__tests__/list.spec.tsx b/web/app/components/apps/__tests__/list.spec.tsx
index 4e9fa240af9..e5a9e4f4127 100644
--- a/web/app/components/apps/__tests__/list.spec.tsx
+++ b/web/app/components/apps/__tests__/list.spec.tsx
@@ -716,17 +716,6 @@ describe('List', () => {
},
})
})
-
- it('should remove legacy tagIDs from URL while preserving other filters', async () => {
- renderList('?category=workflow&tagIDs=tag-1;tag-2&keywords=sales')
-
- await waitFor(() => {
- expect(mockReplace).toHaveBeenCalledWith(
- '/apps?category=workflow&keywords=sales',
- { scroll: false },
- )
- })
- })
})
describe('Tag Filter', () => {
diff --git a/web/app/components/apps/list.tsx b/web/app/components/apps/list.tsx
index 7287606ae68..a1cf1a39c15 100644
--- a/web/app/components/apps/list.tsx
+++ b/web/app/components/apps/list.tsx
@@ -11,7 +11,6 @@ import { useAppContext } from '@/context/app-context'
import { useProviderContext } from '@/context/provider-context'
import { systemFeaturesQueryOptions } from '@/features/system-features/client'
import { CheckModal } from '@/hooks/use-pay'
-import { usePathname, useRouter, useSearchParams } from '@/next/navigation'
import { consoleQuery } from '@/service/client'
import { normalizeAppPagination } from '@/service/use-apps'
import { AppModeEnum } from '@/types/app'
@@ -46,9 +45,6 @@ function List({
const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions())
const { workspacePermissionKeys } = useAppContext()
const { onPlanInfoChanged } = useProviderContext()
- const searchParams = useSearchParams()
- const pathname = usePathname()
- const { replace } = useRouter()
// eslint-disable-next-line react/use-state -- custom URL query hook, not React.useState
const {
@@ -83,16 +79,6 @@ function List({
enabled: canCreateApp,
})
- useEffect(() => {
- if (!searchParams.has('tagIDs'))
- return
-
- const params = new URLSearchParams(searchParams.toString())
- params.delete('tagIDs')
- const query = params.toString()
- replace(query ? `${pathname}?${query}` : pathname, { scroll: false })
- }, [pathname, replace, searchParams])
-
const appListQuery = useMemo<AppListQuery>(() => ({
page: 1,
limit: 30,