revert: be7d45afe2 (#16742)
This commit is contained in:
1 parent
b84cdc0d45
commit
97f213f260
2 files changed
+5
-58
No files matched your search
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import type { SetStateAction, Dispatch } from "react";
|
||||
import { useMemo, useState, useEffect } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { Controller, useFieldArray, useForm, useWatch } from "react-hook-form";
|
||||
|
||||
import dayjs from "@calcom/dayjs";
|
||||
@@ -263,20 +263,6 @@ export function AvailabilitySettings({
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const subscription = form.watch(
|
||||
(value, { name }) => {
|
||||
if (!!name && name.split(".")[0] !== "schedule" && name !== "name")
|
||||
handleSubmit(value as AvailabilityFormValues);
|
||||
},
|
||||
{
|
||||
...schedule,
|
||||
schedule: schedule.availability || [],
|
||||
}
|
||||
);
|
||||
return () => subscription.unsubscribe();
|
||||
}, [form.watch]);
|
||||
|
||||
const [Shell, Schedule, TimezoneSelect] = useMemo(() => {
|
||||
return isPlatform
|
||||
? [PlatformShell, PlatformSchedule, PlatformTimzoneSelect]
|
||||
@@ -533,7 +519,6 @@ export function AvailabilitySettings({
|
||||
control={form.control}
|
||||
name="schedule"
|
||||
userTimeFormat={timeFormat}
|
||||
handleSubmit={handleSubmit}
|
||||
weekStart={
|
||||
["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"].indexOf(
|
||||
weekStart
|
||||
|
||||
Reference in new issue
Block a user