mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: email preferences form reset (#4464)
This commit is contained in:
parent
e6142d8247
commit
fd4aa38dc2
@ -1,4 +1,4 @@
|
|||||||
import React, { FC } from "react";
|
import React, { FC, useEffect } from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { IUserEmailNotificationSettings } from "@plane/types";
|
import { IUserEmailNotificationSettings } from "@plane/types";
|
||||||
// ui
|
// ui
|
||||||
@ -22,6 +22,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
|
|||||||
watch,
|
watch,
|
||||||
control,
|
control,
|
||||||
setValue,
|
setValue,
|
||||||
|
reset,
|
||||||
formState: { isSubmitting, isDirty, dirtyFields },
|
formState: { isSubmitting, isDirty, dirtyFields },
|
||||||
} = useForm<IUserEmailNotificationSettings>({
|
} = useForm<IUserEmailNotificationSettings>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
@ -50,6 +51,10 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
|
|||||||
.catch((err) => console.error(err));
|
.catch((err) => console.error(err));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
reset(data);
|
||||||
|
}, [reset, data]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex gap-2 items-center pt-6 mb-2 pb-6 border-b border-custom-border-100">
|
<div className="flex gap-2 items-center pt-6 mb-2 pb-6 border-b border-custom-border-100">
|
||||||
|
Loading…
Reference in New Issue
Block a user