mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
fix(profile,connected-accounts): drop dead ['user'] invalidate calls
queryClient.invalidateQueries({ queryKey: ['user'] }) appears twice in
the codebase but no useQuery with that key is registered anywhere — the
auth user is a zustand store, not a React Query cache entry. The
invalidations were silent no-ops that suggested wiring that did not
exist.
The actual refresh path (await getMe + setUser) was already in place
right above each invalidate, so the cleanup is purely cosmetic +
documentation: replace with a comment explaining where the user state
actually lives, so the next reader doesn't try to invalidate it again.
This commit is contained in:
@@ -404,7 +404,8 @@ export default function ConnectedAccounts() {
|
|||||||
const updatedUser = await authApi.getMe();
|
const updatedUser = await authApi.getMe();
|
||||||
setUser(updatedUser);
|
setUser(updatedUser);
|
||||||
queryClient.invalidateQueries({ queryKey: ['linked-providers'] });
|
queryClient.invalidateQueries({ queryKey: ['linked-providers'] });
|
||||||
queryClient.invalidateQueries({ queryKey: ['user'] });
|
// Note: auth user lives in the zustand store, not in React Query —
|
||||||
|
// the explicit setUser above IS the refresh. No ['user'] query exists.
|
||||||
},
|
},
|
||||||
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
||||||
const detail = err.response?.data?.detail;
|
const detail = err.response?.data?.detail;
|
||||||
|
|||||||
@@ -193,7 +193,8 @@ export default function Profile() {
|
|||||||
setChangeEmailStep('success');
|
setChangeEmailStep('success');
|
||||||
const updatedUser = await authApi.getMe();
|
const updatedUser = await authApi.getMe();
|
||||||
setUser(updatedUser);
|
setUser(updatedUser);
|
||||||
queryClient.invalidateQueries({ queryKey: ['user'] });
|
// Note: auth user lives in the zustand store, not in React Query —
|
||||||
|
// the explicit setUser above IS the refresh. No ['user'] query exists.
|
||||||
},
|
},
|
||||||
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
onError: (err: { response?: { data?: { detail?: string } } }) => {
|
||||||
const detail = err.response?.data?.detail;
|
const detail = err.response?.data?.detail;
|
||||||
|
|||||||
Reference in New Issue
Block a user