perf: optimize profile cache updating

This commit is contained in:
7w1 committed 2026-08-27 21:29:37 -05:00
1 parent d7ebfab677
commit e94becdc3f
1 file changed
+4 -7
+4 -7
View File
@@ -322,13 +322,10 @@ export const useUserProfile = (
return;
}
const normalized = normalizeInfo(info);
setGlobalProfiles((prev) => {
const { [userId]: previousProfile, ...otherProfiles } = prev;
return {
...otherProfiles,
[userId]: { ...previousProfile, ...normalized },
};
});
setGlobalProfiles((prev) => ({
...prev,
[userId]: { ...prev[userId], ...normalized },
}));
})
.catch(() => {
if (getFetchGeneration(mx, userId) !== generation) {