Skip to content

Commit

Permalink
check if process exists before accessing it
Browse files Browse the repository at this point in the history
  • Loading branch information
handeyeco committed Oct 21, 2024
1 parent 5a6ba47 commit 559ec54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/math-input/src/components/i18n-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type I18nContextType = {
// @ts-expect-error - TS2322 - Type 'Context<{ strings: {}; locale: string; }>' is not assignable to type 'Context<I18nContextType>'.
export const MathInputI18nContext: React.Context<I18nContextType> =
React.createContext(
process.env.NODE_ENV === "test" || process.env.STORYBOOK
process?.env?.NODE_ENV === "test" || process?.env?.STORYBOOK
? {
strings: mockStrings,
locale: "en",
Expand Down
2 changes: 1 addition & 1 deletion packages/perseus/src/components/i18n-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type I18nContextType = {
// @ts-expect-error - TS2322 - Type 'Context<{ strings: {}; locale: string; }>' is not assignable to type 'Context<I18nContextType>'.
export const PerseusI18nContext: React.Context<I18nContextType> =
React.createContext(
process.env.NODE_ENV === "test" || process.env.STORYBOOK
process?.env?.NODE_ENV === "test" || process?.env?.STORYBOOK
? {
strings: mockStrings,
locale: "en",
Expand Down

0 comments on commit 559ec54

Please sign in to comment.