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