Skip to content

Commit

Permalink
fix: removed 'useEffect' from 'PhoneNumberFormField.tsx' Component
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidSumra committed Oct 17, 2024
1 parent e39adc5 commit 1c3c769
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
4 changes: 0 additions & 4 deletions src/Components/Form/FormFields/PhoneNumberFormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ export default function PhoneNumberFormField(props: Props) {
}
}, [setValue]);

useEffect(() => {
setValue(field.value || "+91");
}, []);

return (
<FormField
field={{
Expand Down
12 changes: 1 addition & 11 deletions src/Components/Users/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,7 @@ export default function UserProfile() {
type: "set_form",
form: { ...states.form, [event.name]: event.value },
});

const isMobileNumberModified =
(event.name === "phoneNumber" || event.name === "altPhoneNumber") &&
(event.value == userData?.alt_phone_number ||
event.value == userData?.phone_number);

if (isMobileNumberModified) {
setDirty(false);
} else {
setDirty(true);
}
setDirty(true);
};

const getDate = (value: any) =>
Expand Down

0 comments on commit 1c3c769

Please sign in to comment.