fix: when error can not install

pull/12372/head
Joel 2 years ago
parent a093a48675
commit e151c2ee8c

@ -30,8 +30,12 @@ const InstallByDSLList: FC<Props> = ({
return [] return []
const _plugins = allPlugins.map((d) => { const _plugins = allPlugins.map((d) => {
if (d.type === 'package') if (d.type === 'package') {
return (d as any).value.manifest return {
...(d as any).value.manifest,
plugin_id: (d as any).value.unique_identifier,
}
}
return undefined return undefined
}) })
@ -84,7 +88,7 @@ const InstallByDSLList: FC<Props> = ({
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [isFetchingMarketplaceData]) }, [isFetchingMarketplaceData])
const isLoadedAllData = allPlugins.length === plugins.length && plugins.every(p => !!p) const isLoadedAllData = (plugins.filter(p => !!p).length + errorIndexes.length) === allPlugins.length
useEffect(() => { useEffect(() => {
if (isLoadedAllData) if (isLoadedAllData)
onLoadedAllPlugin() onLoadedAllPlugin()

@ -5,7 +5,7 @@ import type { Dependency, InstallStatusResponse, Plugin } from '../../../types'
import Button from '@/app/components/base/button' import Button from '@/app/components/base/button'
import { RiLoader2Line } from '@remixicon/react' import { RiLoader2Line } from '@remixicon/react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import InstallByDSLList from './install-multi' import InstallMulti from './install-multi'
import { useInstallFromMarketplaceAndGitHub } from '@/service/use-plugins' import { useInstallFromMarketplaceAndGitHub } from '@/service/use-plugins'
import { useInvalidateInstalledPluginList } from '@/service/use-plugins' import { useInvalidateInstalledPluginList } from '@/service/use-plugins'
const i18nPrefix = 'plugin.installModal' const i18nPrefix = 'plugin.installModal'
@ -67,7 +67,7 @@ const Install: FC<Props> = ({
<p>{t(`${i18nPrefix}.${selectedPluginsNum > 1 ? 'readyToInstallPackages' : 'readyToInstallPackage'}`, { num: selectedPluginsNum })}</p> <p>{t(`${i18nPrefix}.${selectedPluginsNum > 1 ? 'readyToInstallPackages' : 'readyToInstallPackage'}`, { num: selectedPluginsNum })}</p>
</div> </div>
<div className='w-full p-2 rounded-2xl bg-background-section-burn space-y-1'> <div className='w-full p-2 rounded-2xl bg-background-section-burn space-y-1'>
<InstallByDSLList <InstallMulti
allPlugins={allPlugins} allPlugins={allPlugins}
selectedPlugins={selectedPlugins} selectedPlugins={selectedPlugins}
onSelect={handleSelect} onSelect={handleSelect}

Loading…
Cancel
Save