Преглед на файлове

Fix plugin detail panel not show when installed plugins more than 100 (#26405)

tags/1.9.1
KVOJJJin преди 1 месец
родител
ревизия
d2f0551170
No account linked to committer's email address
променени са 1 файла, в които са добавени 7 реда и са изтрити 5 реда
  1. 7
    5
      web/app/components/tools/provider-list.tsx

+ 7
- 5
web/app/components/tools/provider-list.tsx Целия файл

import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel' import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
import MCPList from './mcp' import MCPList from './mcp'
import { useAllToolProviders } from '@/service/use-tools' import { useAllToolProviders } from '@/service/use-tools'
import { useInstalledPluginList, useInvalidateInstalledPluginList } from '@/service/use-plugins'
import { useCheckInstalled, useInvalidateInstalledPluginList } from '@/service/use-plugins'
import { useGlobalPublicStore } from '@/context/global-public-context' import { useGlobalPublicStore } from '@/context/global-public-context'
import { ToolTypeEnum } from '../workflow/block-selector/types' import { ToolTypeEnum } from '../workflow/block-selector/types'
import { useMarketplace } from './marketplace/hooks' import { useMarketplace } from './marketplace/hooks'
const currentProvider = useMemo<Collection | undefined>(() => { const currentProvider = useMemo<Collection | undefined>(() => {
return filteredCollectionList.find(collection => collection.id === currentProviderId) return filteredCollectionList.find(collection => collection.id === currentProviderId)
}, [currentProviderId, filteredCollectionList]) }, [currentProviderId, filteredCollectionList])
const { data: pluginList } = useInstalledPluginList()
const { data: checkedInstalledData } = useCheckInstalled({
pluginIds: currentProvider?.plugin_id ? [currentProvider.plugin_id] : [],
enabled: !!currentProvider?.plugin_id,
})
const invalidateInstalledPluginList = useInvalidateInstalledPluginList() const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
const currentPluginDetail = useMemo(() => { const currentPluginDetail = useMemo(() => {
const detail = pluginList?.plugins.find(plugin => plugin.plugin_id === currentProvider?.plugin_id)
return detail
}, [currentProvider?.plugin_id, pluginList?.plugins])
return checkedInstalledData?.plugins?.[0]
}, [checkedInstalledData])


const toolListTailRef = useRef<HTMLDivElement>(null) const toolListTailRef = useRef<HTMLDivElement>(null)
const showMarketplacePanel = useCallback(() => { const showMarketplacePanel = useCallback(() => {

Loading…
Отказ
Запис