From 73838b7a4d718ea055f47c6033fb078a81d1f76e Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Thu, 23 May 2024 10:40:09 -0400 Subject: [PATCH] DEVPROD-7541: Don't validate host sleep schedule in prod (#136) --- apps/spruce/src/components/Spawn/utils/hostUptime.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/spruce/src/components/Spawn/utils/hostUptime.ts b/apps/spruce/src/components/Spawn/utils/hostUptime.ts index 1cba78953..8fe9a7f55 100644 --- a/apps/spruce/src/components/Spawn/utils/hostUptime.ts +++ b/apps/spruce/src/components/Spawn/utils/hostUptime.ts @@ -3,6 +3,7 @@ import { ValidateProps } from "components/SpruceForm"; import { SleepScheduleInput } from "gql/generated/types"; import { MyHost } from "types/spawn"; import { arraySymmetricDifference } from "utils/array"; +import { isProduction } from "utils/environmentVariables"; const daysInWeek = 7; const hoursInDay = 24; @@ -227,6 +228,9 @@ export const matchesDefaultUptimeSchedule = ( }; export const validator = (({ expirationDetails }, errors) => { + // TODO DEVPROD-6908 remove check when beta period ends + if (isProduction()) return errors; + const { hostUptime, noExpiration } = expirationDetails ?? {}; if (!hostUptime || noExpiration === false) return errors;