mirror of https://github.com/langgenius/dify.git
Fix plugin detail panel not show when installed plugins more than 100 (#26405)
This commit is contained in:
parent
cba2b9b2ad
commit
d2f0551170
|
|
@ -17,7 +17,7 @@ import CardMoreInfo from '@/app/components/plugins/card/card-more-info'
|
||||||
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'
|
||||||
|
|
@ -77,12 +77,14 @@ const ProviderList = () => {
|
||||||
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 checkedInstalledData?.plugins?.[0]
|
||||||
return detail
|
}, [checkedInstalledData])
|
||||||
}, [currentProvider?.plugin_id, pluginList?.plugins])
|
|
||||||
|
|
||||||
const toolListTailRef = useRef<HTMLDivElement>(null)
|
const toolListTailRef = useRef<HTMLDivElement>(null)
|
||||||
const showMarketplacePanel = useCallback(() => {
|
const showMarketplacePanel = useCallback(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue