From 5854c3b0a95137ee93135660eb86deae6b86b879 Mon Sep 17 00:00:00 2001 From: Xharles Date: Tue, 26 Mar 2024 13:20:20 +0100 Subject: [PATCH] handle bad setstate --- .../frontend/src/mobile-components/profile/UserSettings.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/mobile-components/profile/UserSettings.tsx b/packages/frontend/src/mobile-components/profile/UserSettings.tsx index 523b59ade..34faef0a4 100644 --- a/packages/frontend/src/mobile-components/profile/UserSettings.tsx +++ b/packages/frontend/src/mobile-components/profile/UserSettings.tsx @@ -107,7 +107,11 @@ const UserSettings: FC = ({ const [isProfileUpdated, setIsProfileUpdated] = useState(false); const prevIsSavingProfile = usePrevious(isSavingProfile); - if (prevIsSavingProfile === true && isSavingProfile === false) { + if ( + prevIsSavingProfile === true && + isSavingProfile === false && + isProfileUpdated === false + ) { setIsProfileUpdated(true); }