fix badge & refresh state of tool install state

This commit is contained in:
JzoNg
2025-01-07 14:41:48 +08:00
parent b39acd0bad
commit 46614cc6f5
4 changed files with 31 additions and 4 deletions

View File

@ -32,7 +32,7 @@ import {
useInvalidateAllBuiltInTools,
useUpdateProviderCredentials,
} from '@/service/use-tools'
import { useInstallPackageFromMarketPlace } from '@/service/use-plugins'
import { useInstallPackageFromMarketPlace, useInvalidateInstalledPluginList } from '@/service/use-plugins'
import { usePluginInstalledCheck } from '@/app/components/plugins/plugin-detail-panel/tool-selector/hooks'
import { CollectionType } from '@/app/components/tools/types'
import type { ToolDefaultValue } from '@/app/components/workflow/block-selector/types'
@ -94,6 +94,7 @@ const ToolSelector: FC<Props> = ({
const { data: customTools } = useAllCustomTools()
const { data: workflowTools } = useAllWorkflowTools()
const invalidateAllBuiltinTools = useInvalidateAllBuiltInTools()
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
// plugin info check
const { inMarketPlace, manifest } = usePluginInstalledCheck(value?.provider_name)
@ -183,6 +184,7 @@ const ToolSelector: FC<Props> = ({
try {
await installPackageFromMarketPlace(manifest.latest_package_identifier)
invalidateAllBuiltinTools()
invalidateInstalledPluginList()
}
catch (e: any) {
Toast.notify({ type: 'error', message: `${e.message || e}` })