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 { categoriesMap } = useCategories()
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) =>
obj?.[locale] || obj?.['en-US'] || obj?.en_US || ''

View File

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

View File

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