pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix account nickname not updating or displaying

Pas 04a08af5 067b6e43

+23 -6
+10
src/hooks/auth/useAuth.ts
··· 188 188 getGroupOrder(backendUrl, account), 189 189 ]); 190 190 191 + // Update account store with fresh user data (including nickname) 192 + const { setAccount } = useAuthStore.getState(); 193 + if (account) { 194 + setAccount({ 195 + ...account, 196 + nickname: user.user.nickname, 197 + profile: user.user.profile, 198 + }); 199 + } 200 + 191 201 syncData( 192 202 user.user, 193 203 user.session,
+5 -6
src/pages/Settings.tsx
··· 485 485 ); 486 486 487 487 const account = useAuthStore((s) => s.account); 488 - const setAccount = useAuthStore((s) => s.setAccount); 489 488 const updateProfile = useAuthStore((s) => s.setAccountProfile); 490 489 const updateDeviceName = useAuthStore((s) => s.updateDeviceName); 490 + const updateNickname = useAuthStore((s) => s.setAccountNickname); 491 491 const decryptedName = useMemo(() => { 492 492 if (!account) return ""; 493 493 return decryptData(account.deviceName, base64ToBuffer(account.seed)); ··· 656 656 await editUser(backendUrl, account, { 657 657 nickname: state.nickname.state, 658 658 }); 659 - // Update the account in the store 660 - const updatedAccount = { ...account, nickname: state.nickname.state }; 661 - setAccount(updatedAccount); 659 + updateNickname(state.nickname.state); 662 660 } 663 - if (state.profile.changed) { 661 + if (state.profile.changed && state.profile.state) { 664 662 await editUser(backendUrl, account, { 665 663 profile: state.profile.state, 666 664 }); 665 + updateProfile(state.profile.state); 667 666 } 668 667 } 669 668 ··· 734 733 setProxySet, 735 734 updateDeviceName, 736 735 updateProfile, 737 - setAccount, 736 + updateNickname, 738 737 logout, 739 738 setBackendUrl, 740 739 setProxyTmdb,
+8
src/stores/auth/index.ts
··· 28 28 updateDeviceName(deviceName: string): void; 29 29 updateAccount(acc: Partial<Account>): void; 30 30 setAccountProfile(acc: Account["profile"]): void; 31 + setAccountNickname(nickname: string): void; 31 32 setBackendUrl(url: null | string): void; 32 33 setProxySet(urls: null | string[]): void; 33 34 } ··· 62 63 set((s) => { 63 64 if (s.account) { 64 65 s.account.profile = profile; 66 + } 67 + }); 68 + }, 69 + setAccountNickname(nickname) { 70 + set((s) => { 71 + if (s.account) { 72 + s.account.nickname = nickname; 65 73 } 66 74 }); 67 75 },