From 11779e8f03ca99bb12d979dbd646233ee19e5a4c Mon Sep 17 00:00:00 2001 From: marek777-lol Date: Sun, 17 Nov 2024 11:48:36 +0100 Subject: [PATCH] added dynamic update button disabling --- src/pages/edit-profile/EditProfile.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/edit-profile/EditProfile.tsx b/src/pages/edit-profile/EditProfile.tsx index a239695e8..728bf463c 100644 --- a/src/pages/edit-profile/EditProfile.tsx +++ b/src/pages/edit-profile/EditProfile.tsx @@ -70,6 +70,9 @@ const EditProfile = () => { const isTabInvalid = errorTooltipHolders.profile || errorTooltipHolders.professionalInfo + const isPasswordSecurityTab = + activeTab === UserProfileTabsEnum.PasswordAndSecurity + const hasChanges = ( initialData: Partial, currentData: Partial @@ -77,6 +80,10 @@ const EditProfile = () => { return JSON.stringify(initialData) !== JSON.stringify(currentData) } + useEffect(() => { + console.log('isPasswordSecurityTab', isPasswordSecurityTab) + }) + useEffect(() => { const fetchData = async () => { await dispatch( @@ -211,7 +218,7 @@ const EditProfile = () => { void handleUpdateUser()} size={SizeEnum.Large} sx={styles.updateBtn}