diff --git a/client/src/app/settings/edit.tsx b/client/src/app/settings/edit.tsx index 29df1bc..5bc7b77 100644 --- a/client/src/app/settings/edit.tsx +++ b/client/src/app/settings/edit.tsx @@ -15,10 +15,11 @@ import { import { t } from "i18next"; import { AlertCircleIcon } from "lucide-react"; -import { useMemo } from "react"; +import { useMemo, useState } from "react"; import { SubmitHandler, useForm } from "react-hook-form"; import { Trans } from "react-i18next"; +import { cn } from "@/lib/utils"; import { IUpdateProfile_Request_DTO } from "@shared/contexts"; import { Link } from "react-router-dom"; import { toast } from "react-toastify"; @@ -27,6 +28,7 @@ import { useSettings } from "./hooks"; type SettingsDataForm = IUpdateProfile_Request_DTO; export const SettingsEditor = () => { + const [activeSection, setActiveSection] = useState("profile"); const { useOne, useUpdate } = useSettings(); const { data, status, error: queryError } = useOne(); @@ -61,7 +63,7 @@ export const SettingsEditor = () => { ),*/ }); - const { formState } = form; + const { formState, reset } = form; const { isSubmitting } = formState; const onSubmit: SubmitHandler = async (data) => { @@ -74,6 +76,7 @@ export const SettingsEditor = () => { }, //onSettled: () => {}, onSuccess: () => { + reset({}, { keepValues: true, keepIsValid: true }); toast("Ajustes guardados"); //clear(); }, @@ -114,17 +117,29 @@ export const SettingsEditor = () => { )} -
+
@@ -136,6 +151,7 @@ export const SettingsEditor = () => { { - +
+
@@ -161,6 +178,7 @@ export const SettingsEditor = () => { { - @@ -186,6 +203,7 @@ export const SettingsEditor = () => { { { - +
+
@@ -236,6 +256,7 @@ export const SettingsEditor = () => {