Merge branch 'feat/plugins' of https://github.com/langgenius/dify into feat/plugins

pull/12372/head
twwu 1 year ago
commit f53b658964

@ -9,6 +9,7 @@ import type {
PluginsFromMarketplaceResponse, PluginsFromMarketplaceResponse,
uploadGitHubResponse, uploadGitHubResponse,
} from '@/app/components/plugins/types' } from '@/app/components/plugins/types'
import { TaskStatus } from '@/app/components/plugins/types'
import type { import type {
PluginsSearchParams, PluginsSearchParams,
} from '@/app/components/plugins/marketplace/types' } from '@/app/components/plugins/marketplace/types'
@ -217,14 +218,14 @@ export const usePluginTaskList = () => {
queryKey: usePluginTaskListKey, queryKey: usePluginTaskListKey,
queryFn: async () => { queryFn: async () => {
const currentData = await get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100') const currentData = await get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100')
const taskDone = currentData.tasks.every(task => task.total_plugins === task.completed_plugins) const taskDone = currentData.tasks.every(task => task.status === TaskStatus.success)
if (taskDone) if (taskDone)
setEnabled(false) setEnabled(false)
return currentData return currentData
}, },
// refetchInterval: 5000, refetchInterval: 5000,
enabled, enabled,
}) })
const handleRefetch = useCallback(() => { const handleRefetch = useCallback(() => {

Loading…
Cancel
Save