mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
Revert "refactor!: replace Zustand global store with TanStack Query for systemFeatures"
This reverts commit 806ece9a67.
This commit is contained in:
@ -68,7 +68,8 @@ vi.mock('@/context/app-context', () => ({
|
||||
// Mock global public store
|
||||
const mockEnableMarketplace = vi.fn(() => true)
|
||||
vi.mock('@/context/global-public-context', () => ({
|
||||
useSystemFeatures: () => ({ enable_marketplace: mockEnableMarketplace() }),
|
||||
useGlobalPublicStore: (selector: (s: any) => any) =>
|
||||
selector({ systemFeatures: { enable_marketplace: mockEnableMarketplace() } }),
|
||||
}))
|
||||
|
||||
// Mock Action component
|
||||
|
||||
@ -16,7 +16,7 @@ import Tooltip from '@/app/components/base/tooltip'
|
||||
import useRefreshPluginList from '@/app/components/plugins/install-plugin/hooks/use-refresh-plugin-list'
|
||||
import { API_PREFIX } from '@/config'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
import { useSystemFeatures } from '@/hooks/use-global-public'
|
||||
import { useGlobalPublicStore } from '@/context/global-public-context'
|
||||
import { useRenderI18nObject } from '@/hooks/use-i18n'
|
||||
import useTheme from '@/hooks/use-theme'
|
||||
import { cn } from '@/utils/classnames'
|
||||
@ -85,7 +85,7 @@ const PluginItem: FC<Props> = ({
|
||||
const getValueFromI18nObject = useRenderI18nObject()
|
||||
const title = getValueFromI18nObject(label)
|
||||
const descriptionText = getValueFromI18nObject(description)
|
||||
const { enable_marketplace } = useSystemFeatures()
|
||||
const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures)
|
||||
const iconFileName = theme === 'dark' && icon_dark ? icon_dark : icon
|
||||
const iconSrc = iconFileName
|
||||
? (iconFileName.startsWith('http') ? iconFileName : `${API_PREFIX}/workspaces/current/plugin/icon?tenant_id=${tenant_id}&filename=${iconFileName}`)
|
||||
|
||||
Reference in New Issue
Block a user