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 b728ed6 commit 94a7a59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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 Expand Up @@ -250,6 +254,7 @@ const EditProfile = () => {
params: dataToUpdate
})
)

dispatch(
openAlert({
severity: snackbarVariants.success,
Expand Down

0 comments on commit 94a7a59

Please sign in to comment.