diff --git a/src/pages/edit-profile/EditProfile.tsx b/src/pages/edit-profile/EditProfile.tsx index e757f8bb6..d3200b8e0 100644 --- a/src/pages/edit-profile/EditProfile.tsx +++ b/src/pages/edit-profile/EditProfile.tsx @@ -76,17 +76,17 @@ const EditProfile = () => { const isPasswordSecurityTab = activeTab === UserProfileTabsEnum.PasswordAndSecurity - const areAllValuesEmptyStrings = ( - obj: DataByRole | { [key: string]: string } - ): boolean => { + const areAllValuesEmptyStrings = (obj: { + [key: string]: string + }): boolean => { return Object.values(obj).every( (value) => typeof value === 'string' && value === '' ) } const hasChanges = ( - initialData: Partial, - currentData: Partial + initialData: Partial | DataByRole, + currentData: Partial | DataByRole ): boolean => { return JSON.stringify(initialData) !== JSON.stringify(currentData) } @@ -170,10 +170,7 @@ const EditProfile = () => { photo: currentPhoto } - if ( - areAllValuesEmptyStrings(initialVideoLink) && - areAllValuesEmptyStrings(currentVideoLink) - ) { + if (!hasChanges(initialVideoLink, currentVideoLink)) { delete changes.videoLink }