diff --git a/web/app/components/plugins/marketplace/description/index.tsx b/web/app/components/plugins/marketplace/description/index.tsx
index 337f456e6d..3e500155cf 100644
--- a/web/app/components/plugins/marketplace/description/index.tsx
+++ b/web/app/components/plugins/marketplace/description/index.tsx
@@ -12,6 +12,7 @@ const Description = async ({
const localeDefault = getLocaleOnServer()
const { t } = await translate(localeFromProps || localeDefault, 'plugin')
const { t: tCommon } = await translate(localeFromProps || localeDefault, 'common')
+ const isZhHans = localeFromProps === 'zh-Hans'
return (
<>
@@ -19,7 +20,22 @@ const Description = async ({
{t('marketplace.empower')}
- {t('marketplace.discover')}
+ {
+ isZhHans && (
+ <>
+ {tCommon('operation.in')}
+ {t('marketplace.difyMarketplace')}
+ {t('marketplace.discover')}
+ >
+ )
+ }
+ {
+ !isZhHans && (
+ <>
+ {t('marketplace.discover')}
+ >
+ )
+ }
{t('category.models')}
@@ -39,8 +55,14 @@ const Description = async ({
{t('category.bundles')}
- {tCommon('operation.in')}
- {t('marketplace.difyMarketplace')}
+ {
+ !isZhHans && (
+ <>
+ {tCommon('operation.in')}
+ {t('marketplace.difyMarketplace')}
+ >
+ )
+ }
>
)
diff --git a/web/service/use-plugins.ts b/web/service/use-plugins.ts
index 1673b5fff8..3feb66df8d 100644
--- a/web/service/use-plugins.ts
+++ b/web/service/use-plugins.ts
@@ -1,4 +1,4 @@
-import { useCallback, useState } from 'react'
+import { useCallback } from 'react'
import type {
DebugInfo as DebugInfoTypes,
Dependency,
@@ -356,7 +356,6 @@ export const useFetchPluginsInMarketPlaceByInfo = (infos: Record[])
const usePluginTaskListKey = [NAME_SPACE, 'pluginTaskList']
export const usePluginTaskList = () => {
- const [enabled, setEnabled] = useState(true)
const {
data,
isFetched,
@@ -364,20 +363,17 @@ export const usePluginTaskList = () => {
...rest
} = useQuery({
queryKey: usePluginTaskListKey,
- queryFn: async () => {
- const currentData = await get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100')
- const taskDone = currentData.tasks.every(task => task.status === TaskStatus.success || task.status === TaskStatus.failed)
-
+ queryFn: () => get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100'),
+ refetchInterval: (lastQuery) => {
+ const lastData = lastQuery.state.data
+ const taskDone = lastData?.tasks.every(task => task.status === TaskStatus.success || task.status === TaskStatus.failed)
if (taskDone)
- setEnabled(false)
+ return false
- return currentData
+ return 5000
},
- refetchInterval: 5000,
- enabled,
})
const handleRefetch = useCallback(() => {
- setEnabled(true)
refetch()
}, [refetch])