diff --git a/utils/qa.ts b/utils/qa.ts index f16f4c4a8..3f215d463 100644 --- a/utils/qa.ts +++ b/utils/qa.ts @@ -3,7 +3,7 @@ import { dynamics } from 'config'; export const enableQaHelpers = dynamics.enableQaHelpers; export const overrideWithQAMockBoolean = (value: boolean, key: string) => { - if (enableQaHelpers) { + if (enableQaHelpers && typeof window !== 'undefined') { const mock = localStorage.getItem(key); if (mock) { return mock === 'true'; @@ -13,7 +13,7 @@ export const overrideWithQAMockBoolean = (value: boolean, key: string) => { }; export const overrideWithQAMockNumber = (value: number, key: string) => { - if (enableQaHelpers) { + if (enableQaHelpers && typeof window !== 'undefined') { const mock = localStorage.getItem(key); if (mock && !isNaN(Number(mock))) { return Number(mock);