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: refresh UI after user profile change (#24998)

17hz5aa8c9c8dfb2
diff --git a/web/context/app-context.tsx b/web/context/app-context.tsx
index c033e1dcfaa..ae1bc1269c6 100644
--- a/web/context/app-context.tsx
+++ b/web/context/app-context.tsx
@@ -86,10 +86,9 @@ export const AppContextProvider: FC<AppContextProviderProps> = ({ children }) =>
const isCurrentWorkspaceEditor = useMemo(() => ['owner', 'admin', 'editor'].includes(currentWorkspace.role), [currentWorkspace.role])
const isCurrentWorkspaceDatasetOperator = useMemo(() => currentWorkspace.role === 'dataset_operator', [currentWorkspace.role])
const updateUserProfileAndVersion = useCallback(async () => {
- if (userProfileResponse) {
+ if (userProfileResponse && !userProfileResponse.bodyUsed) {
try {
- const clonedResponse = (userProfileResponse as Response).clone()
- const result = await clonedResponse.json()
+ 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')