mirror of
https://github.com/langgenius/dify.git
synced 2026-01-13 21:57:48 +08:00
fix: refresh UI after user profile change (#24998)
This commit is contained in:
parent
32972b45db
commit
5aa8c9c8df
@ -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')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user