From c3ac1bcc8c7ff8dc7ebf178d23a6e5c7ea223749 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 26 Jul 2022 17:53:43 -0600 Subject: [PATCH] Update [schedule].tsx --- apps/web/pages/availability/[schedule].tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/web/pages/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx index 66e1e80e7c..dd94065915 100644 --- a/apps/web/pages/availability/[schedule].tsx +++ b/apps/web/pages/availability/[schedule].tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/router"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; -import { DEFAULT_SCHEDULE, availabilityAsString } from "@calcom/lib/availability"; +import { availabilityAsString, DEFAULT_SCHEDULE } from "@calcom/lib/availability"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import showToast from "@calcom/lib/notification"; import { inferQueryOutput, trpc } from "@calcom/trpc/react"; @@ -127,12 +127,10 @@ export function AvailabilityForm(props: inferQueryOutput<"viewer.availability.sc export default function Availability() { const router = useRouter(); const { i18n } = useLocale(); - const query = trpc.useQuery([ - "viewer.availability.schedule", - { - scheduleId: parseInt(router.query.schedule as string), - }, - ]); + const query = trpc.useQuery( + ["viewer.availability.schedule", { scheduleId: parseInt(router.query.schedule as string) }], + { enabled: router.isReady } + ); const [name, setName] = useState(); return (