chore: add on start to install

This commit is contained in:
Joel
2024-11-01 14:51:35 +08:00
parent 9f08206503
commit 245bb02c88
2 changed files with 9 additions and 2 deletions

View File

@@ -13,10 +13,11 @@ import checkTaskStatus from '../../base/check-task-status'
const i18nPrefix = 'plugin.installModal'
interface Props {
type Props = {
uniqueIdentifier: string
payload: PluginDeclaration
onCancel: () => void
onStartToInstall?: () => void
onInstalled: () => void
onFailed: (message?: string) => void
}
@@ -25,6 +26,7 @@ const Installed: FC<Props> = ({
uniqueIdentifier,
payload,
onCancel,
onStartToInstall,
onInstalled,
onFailed,
}) => {
@@ -43,6 +45,8 @@ const Installed: FC<Props> = ({
const handleInstall = async () => {
if (isInstalling) return
setIsInstalling(true)
onStartToInstall?.()
try {
const {
all_installed: isInstalled,

View File

@@ -18,6 +18,7 @@ type Props = {
uniqueIdentifier: string
payload: PluginManifestInMarket
onCancel: () => void
onStartToInstall?: () => void
onInstalled: () => void
onFailed: (message?: string) => void
}
@@ -26,6 +27,7 @@ const Installed: FC<Props> = ({
uniqueIdentifier,
payload,
onCancel,
onStartToInstall,
onInstalled,
onFailed,
}) => {
@@ -43,6 +45,7 @@ const Installed: FC<Props> = ({
const handleInstall = async () => {
if (isInstalling) return
onStartToInstall?.()
setIsInstalling(true)
try {
@@ -90,7 +93,7 @@ const Installed: FC<Props> = ({
</>
)
}</>)
}, [payload])
}, [payload.latest_version, supportCheckInstalled])
return (
<>