Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: prevent fetch version info in enterprise edition (#27923)

NFishfe50093c1815
diff --git a/web/context/app-context.tsx b/web/context/app-context.tsx
index 9fd6481440d..644a7a778ff 100644
--- a/web/context/app-context.tsx
+++ b/web/context/app-context.tsx
@@ -10,6 +10,7 @@ import MaintenanceNotice from '@/app/components/header/maintenance-notice'
import { noop } from 'lodash-es'
import { setZendeskConversationFields } from '@/app/components/base/zendesk/utils'
import { ZENDESK_FIELD_IDS } from '@/config'
+import { useGlobalPublicStore } from './global-public-context'
export type AppContextValue = {
userProfile: UserProfileResponse
@@ -77,6 +78,7 @@ export type AppContextProviderProps = {
}
export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) => {
+ const systemFeatures = useGlobalPublicStore(s => s.systemFeatures)
const { data: userProfileResponse, mutate: mutateUserProfile, error: userProfileError } = useSWR({ url: '/account/profile', params: {} }, fetchUserProfile)
const { data: currentWorkspaceResponse, mutate: mutateCurrentWorkspace, isLoading: isLoadingCurrentWorkspace } = useSWR({ url: '/workspaces/current', params: {} }, fetchCurrentWorkspace)
@@ -92,10 +94,12 @@ export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) =>
try {
const result = await userProfileResponse.json()
setUserProfile(result)
- const current_version = userProfileResponse.headers.get('x-version')
- const current_env = process.env.NODE_ENV === 'development' ? 'DEVELOPMENT' : userProfileResponse.headers.get('x-env')
- const versionData = await fetchLangGeniusVersion({ url: '/version', params: { current_version } })
- setLangGeniusVersionInfo({ ...versionData, current_version, latest_version: versionData.version, current_env })
+ if (!systemFeatures.branding.enabled) {
+ const current_version = userProfileResponse.headers.get('x-version')
+ const current_env = process.env.NODE_ENV === 'development' ? 'DEVELOPMENT' : userProfileResponse.headers.get('x-env')
+ const versionData = await fetchLangGeniusVersion({ url: '/version', params: { current_version } })
+ setLangGeniusVersionInfo({ ...versionData, current_version, latest_version: versionData.version, current_env })
+ }
}
catch (error) {
console.error('Failed to update user profile:', error)