Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-2289] fix: email notification settings form validation (#5413)

Anmol Singh Bhatia48e9042970db
diff --git a/web/core/components/profile/notification/email-notification-form.tsx b/web/core/components/profile/notification/email-notification-form.tsx
index 4166634a9d..990ade067a 100644
--- a/web/core/components/profile/notification/email-notification-form.tsx
+++ b/web/core/components/profile/notification/email-notification-form.tsx
@@ -21,11 +21,9 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
// form data
const {
handleSubmit,
- watch,
control,
- setValue,
reset,
- formState: { isSubmitting, isDirty, dirtyFields },
+ formState: { isSubmitting, dirtyFields },
} = useForm<IUserEmailNotificationSettings>({
defaultValues: {
...data,
@@ -93,9 +91,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
render={({ field: { value, onChange } }) => (
<Checkbox
checked={value}
- indeterminate={!value && watch("issue_completed")}
onChange={() => {
- setValue("issue_completed", !value, { shouldDirty: true });
onChange(!value);
}}
containerClassName="mx-2"
@@ -155,7 +151,7 @@ export const EmailNotificationForm: FC<IEmailNotificationFormProps> = (props) =>
</div>
</div>
<div className="flex items-center py-12">
- <Button variant="primary" onClick={handleSubmit(onSubmit)} loading={isSubmitting} disabled={!isDirty}>
+ <Button variant="primary" onClick={handleSubmit(onSubmit)} loading={isSubmitting}>
{isSubmitting ? "Saving..." : "Save changes"}
</Button>
</div>