fix: agent app tool update (#20490)

This commit is contained in:
zxhlyh
2025-05-30 14:56:32 +08:00
committed by GitHub
parent c8d9f8e2e4
commit e303417e04
4 changed files with 51 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import InstallMulti from './install-multi'
import { useInstallOrUpdate } from '@/service/use-plugins'
import useRefreshPluginList from '../../hooks/use-refresh-plugin-list'
import { useCanInstallPluginFromMarketplace } from '@/app/components/plugins/plugin-page/use-permission'
import { useMittContextSelector } from '@/context/mitt-context'
const i18nPrefix = 'plugin.installModal'
type Props = {
@@ -29,6 +30,7 @@ const Install: FC<Props> = ({
isHideButton,
}) => {
const { t } = useTranslation()
const emit = useMittContextSelector(s => s.emit)
const [selectedPlugins, setSelectedPlugins] = React.useState<Plugin[]>([])
const [selectedIndexes, setSelectedIndexes] = React.useState<number[]>([])
const selectedPluginsNum = selectedPlugins.length
@@ -63,8 +65,12 @@ const Install: FC<Props> = ({
})
}))
const hasInstallSuccess = res.some(r => r.success)
if (hasInstallSuccess)
if (hasInstallSuccess) {
refreshPluginList(undefined, true)
emit('plugin:install:success', selectedPlugins.map((p) => {
return `${p.plugin_id}/${p.name}`
}))
}
},
})
const handleInstall = () => {