fix: install plugin type show error

This commit is contained in:
Joel 2024-12-04 18:05:50 +08:00
parent becdca24df
commit 44b0039e8b
3 changed files with 3 additions and 2 deletions

View File

@ -44,7 +44,7 @@ const Card = ({
const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale
const { categoriesMap } = useCategories() const { categoriesMap } = useCategories()
const { type, category, name, org, label, brief, icon, verified } = payload const { type, category, name, org, label, brief, icon, verified } = payload
const cornerMark = type !== 'plugin' ? categoriesMap.bundle?.label : categoriesMap[category]?.label const cornerMark = !['plugin', 'model', 'tool', 'extension'].includes(type) ? categoriesMap.bundle?.label : categoriesMap[category]?.label
const getLocalizedText = (obj: Record<string, string> | undefined) => const getLocalizedText = (obj: Record<string, string> | undefined) =>
obj?.[locale] || obj?.['en-US'] || obj?.en_US || '' obj?.[locale] || obj?.['en-US'] || obj?.en_US || ''

View File

@ -45,6 +45,7 @@ const Installed: FC<Props> = ({
useEffect(() => { useEffect(() => {
if (hasInstalled && uniqueIdentifier === installedInfoPayload.uniqueIdentifier) if (hasInstalled && uniqueIdentifier === installedInfoPayload.uniqueIdentifier)
onInstalled() onInstalled()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [hasInstalled]) }, [hasInstalled])
const [isInstalling, setIsInstalling] = React.useState(false) const [isInstalling, setIsInstalling] = React.useState(false)

View File

@ -107,7 +107,7 @@ export type PluginDetail = {
} }
export type Plugin = { export type Plugin = {
type: 'plugin' | 'bundle' type: 'plugin' | 'bundle' | 'model' | 'extension' | 'tool'
org: string org: string
author?: string author?: string
name: string name: string