From 94a7a599d2ac4d51f0581cc25e92947d71b3b79e Mon Sep 17 00:00:00 2001 From: luiqor Date: Sat, 23 Nov 2024 13:24:56 +0200 Subject: [PATCH] add fetching user data from server on page unload to prevent showing not applied changes --- src/pages/edit-profile/EditProfile.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/edit-profile/EditProfile.tsx b/src/pages/edit-profile/EditProfile.tsx index e757f8bb6d..56d824f9aa 100644 --- a/src/pages/edit-profile/EditProfile.tsx +++ b/src/pages/edit-profile/EditProfile.tsx @@ -141,6 +141,10 @@ const EditProfile = () => { ) } void fetchData() + + return () => { + void fetchData() + } }, [dispatch, userId, userRole]) useEffect(() => { @@ -250,6 +254,7 @@ const EditProfile = () => { params: dataToUpdate }) ) + dispatch( openAlert({ severity: snackbarVariants.success,