Fix some UI issues 2
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
AuthHealthResponse
|
||||
} from '../types/auth';
|
||||
import { ApiError } from '../client';
|
||||
import { useAuthStore } from '../../stores/auth.store';
|
||||
|
||||
// Query Keys
|
||||
export const authKeys = {
|
||||
@@ -149,6 +150,11 @@ export const useUpdateProfile = (
|
||||
onSuccess: (data) => {
|
||||
// Update the profile cache
|
||||
queryClient.setQueryData(authKeys.profile(), data);
|
||||
// Update the auth store user to maintain consistency
|
||||
const authStore = useAuthStore.getState();
|
||||
if (authStore.user) {
|
||||
authStore.updateUser(data);
|
||||
}
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user