fix: load package dsl error

This commit is contained in:
Joel
2024-11-20 14:27:46 +08:00
parent bb2914652a
commit 40d025052d
3 changed files with 26 additions and 22 deletions

View File

@ -5,6 +5,7 @@ import type { Plugin } from '../../../types'
import type { PackageDependency } from '../../../types'
import { pluginManifestToCardPluginProps } from '../../utils'
import LoadedItem from './loaded-item'
import LoadingError from '../../base/loading-error'
type Props = {
checked: boolean
@ -17,6 +18,9 @@ const PackageItem: FC<Props> = ({
checked,
onCheckedChange,
}) => {
if (!payload.value?.manifest)
return <LoadingError />
const plugin = pluginManifestToCardPluginProps(payload.value.manifest)
return (
<LoadedItem

View File

@ -24,7 +24,7 @@ const InstallByDSLList: FC<Props> = ({
onLoadedAllPlugin,
}) => {
const { isLoading: isFetchingMarketplaceData, data: marketplaceRes } = useFetchPluginsInMarketPlaceByIds(allPlugins.filter(d => d.type === 'marketplace').map(d => (d as GitHubItemAndMarketPlaceDependency).value.plugin_unique_identifier!))
console.log(allPlugins)
// console.log(allPlugins)
const [plugins, setPlugins, getPlugins] = useGetState<(Plugin | undefined)[]>((() => {
const hasLocalPackage = allPlugins.some(d => d.type === 'package')
if (!hasLocalPackage)