Only enable when defaultScheduleId is truthy (#9968)
parent
afd41475c9
commit
cbe1907118
|
@ -22,15 +22,13 @@ const SetupAvailability = (props: ISetupAvailabilityProps) => {
|
||||||
const { nextStep } = props;
|
const { nextStep } = props;
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
let queryAvailability;
|
|
||||||
if (defaultScheduleId) {
|
const queryAvailability = trpc.viewer.availability.schedule.get.useQuery(
|
||||||
queryAvailability = trpc.viewer.availability.schedule.get.useQuery(
|
{ scheduleId: defaultScheduleId! },
|
||||||
{ scheduleId: defaultScheduleId },
|
{
|
||||||
{
|
enabled: router.isReady && !!defaultScheduleId,
|
||||||
enabled: router.isReady,
|
}
|
||||||
}
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const availabilityForm = useForm({
|
const availabilityForm = useForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|
Loading…
Reference in New Issue