From 3f2baf013111e0e19dadd15378fd0394f70669e1 Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Fri, 15 Nov 2024 15:46:29 +0800 Subject: [PATCH] fix: plugin task --- web/app/components/plugins/plugin-page/plugin-tasks/hooks.ts | 2 +- web/app/components/plugins/plugin-page/plugin-tasks/index.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/hooks.ts b/web/app/components/plugins/plugin-page/plugin-tasks/hooks.ts index 37a6859cb1..3ebafe5ba6 100644 --- a/web/app/components/plugins/plugin-page/plugin-tasks/hooks.ts +++ b/web/app/components/plugins/plugin-page/plugin-tasks/hooks.ts @@ -11,7 +11,7 @@ export const usePluginTaskStatus = () => { pluginTasks, } = usePluginTaskList() const { mutate } = useMutationClearTaskPlugin() - const allPlugins = pluginTasks.map(task => task.plugins.map((plugin) => { + const allPlugins = pluginTasks.filter(task => task.status !== TaskStatus.success).map(task => task.plugins.map((plugin) => { return { ...plugin, taskId: task.id, diff --git a/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx b/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx index f08424cf88..2d7ae46874 100644 --- a/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx +++ b/web/app/components/plugins/plugin-page/plugin-tasks/index.tsx @@ -54,6 +54,9 @@ const PluginTasks = () => { return t('plugin.task.installError', { errorLength: errorPlugins.length }) }, [isInstalling, isInstallingWithError, isFailed, errorPlugins, runningPlugins, totalPluginsLength, t]) + if (!totalPluginsLength) + return null + return (