Skip to content

Commit

Permalink
fixed it ig
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelp committed Jan 8, 2025
1 parent 4d4e6f4 commit 01cc8b4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions apps/web/src/components/settings/AccountSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ export default function AccountSettings({
const form = useForm<UserProps>({
resolver: zodResolver(modifyAccountSettingsSchema),
defaultValues: {
firstName: user.firstName,
lastName: user.lastName,
hackerTag: user.hackerTag,
isSearchable: user.isSearchable,
...user,
},

});

const { execute: runModifyAccountSettings, status: loadingState } =
Expand Down Expand Up @@ -74,9 +71,10 @@ export default function AccountSettings({
});

useEffect(()=>{
console.log('is dirty is',form.formState.isDirty);
console.log("form.getValues()",form.getValues());
// console.log('form is dirty',form.formState.dirtyFields);
},[form.formState.dirtyFields])
},[form.formState.isDirty])

function handleSubmit(data: UserProps) {
toast.dismiss();
Expand Down Expand Up @@ -106,7 +104,6 @@ export default function AccountSettings({
<FormLabel>First Name</FormLabel>
<FormControl>
<Input
placeholder="shadcn"
{...field}
/>
</FormControl>
Expand All @@ -122,21 +119,20 @@ export default function AccountSettings({
<FormLabel>Last Name</FormLabel>
<FormControl>
<Input
placeholder="shadcn"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormItem className="flex flex-col md:col-span-2">
{/* <FormItem className="flex flex-col md:col-span-2">
<FormLabel>Email</FormLabel>
<Input value={email} disabled />
<FormDescription>
This field cannot be changed.
</FormDescription>
</FormItem>
</FormItem> */}
</div>
<h2 className="pb-5 pt-7 text-3xl font-semibold">
Public Information
Expand Down

0 comments on commit 01cc8b4

Please sign in to comment.