Skip to content

Commit

Permalink
add fetching user data from server on page unload to prevent showing …
Browse files Browse the repository at this point in the history
…not applied changes
  • Loading branch information
luiqor committed Nov 23, 2024
1 parent 3bcd35c commit 8c242ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/containers/navigation-icons/AccountIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const AccountIcon: FC<AccountIconProps> = ({ openMenu }) => {
return statePhoto.src
}

if (typeof statePhoto === 'string' && statePhoto !== '') {
if (typeof statePhoto === 'string') {
return createUrlPath(
import.meta.env.VITE_APP_IMG_USER_URL || '',
statePhoto
Expand Down
4 changes: 4 additions & 0 deletions src/pages/edit-profile/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ const EditProfile = () => {
)
}
void fetchData()

return () => {
void fetchData()
}
}, [dispatch, userId, userRole])

useEffect(() => {
Expand Down

0 comments on commit 8c242ef

Please sign in to comment.