feat: plugin tasks

This commit is contained in:
StyleZhang
2024-11-01 16:08:05 +08:00
parent 40e171c2c6
commit 8874837dc3
6 changed files with 138 additions and 57 deletions

View File

@ -10,6 +10,7 @@ import { RiLoader2Line } from '@remixicon/react'
import Badge, { BadgeState } from '@/app/components/base/badge/index'
import { installPackageFromLocal } from '@/service/plugins'
import checkTaskStatus from '../../base/check-task-status'
import { usePluginTasksStore } from '@/app/components/plugins/plugin-page/store'
const i18nPrefix = 'plugin.installModal'
@ -42,6 +43,7 @@ const Installed: FC<Props> = ({
onCancel()
}
const setPluginTasksWithPolling = usePluginTasksStore(s => s.setPluginTasksWithPolling)
const handleInstall = async () => {
if (isInstalling) return
setIsInstalling(true)
@ -56,6 +58,7 @@ const Installed: FC<Props> = ({
onInstalled()
return
}
setPluginTasksWithPolling()
await check({
taskId,
pluginUniqueIdentifier: uniqueIdentifier,