Skip to content

Commit 97d773f

Browse files
author
broccoli
committed
fix: reload latest user info after backend state is being updated
ensuring updated user info (e.g. avatar file path) is reloaded after changes. This prevents stale paths being cached by the browser and old resources being requested.
1 parent 404db43 commit 97d773f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ui/src/pages/Users/Settings/Profile/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const Index: React.FC = () => {
4040
keyPrefix: 'settings.profile',
4141
});
4242
const toast = useToast();
43-
const { user, update } = loggedUserInfoStore();
43+
const { update } = loggedUserInfoStore();
4444
const { agent: ucAgent } = userCenterStore();
4545
const { users: usersSetting } = siteInfoStore();
4646
const [mailHash, setMailHash] = useState('');
@@ -241,10 +241,7 @@ const Index: React.FC = () => {
241241

242242
modifyUserInfo(params)
243243
.then(() => {
244-
update({
245-
...user,
246-
...params,
247-
});
244+
getLoggedUserInfo().then(update);
248245
toast.onShow({
249246
msg: t('update', { keyPrefix: 'toast' }),
250247
variant: 'success',

0 commit comments

Comments
 (0)