Skip to content

Commit

Permalink
Merge pull request #45 from MiracleUFO/fix-rn/window-undefined-error-…
Browse files Browse the repository at this point in the history
…react-native

Fix: rn/window undefined error react native
  • Loading branch information
MiracleUFO authored Nov 7, 2024
2 parents 4002816 + ab7a176 commit 16e0bd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ const DEFAULT_QUERY_OPTIONS: QueryClientConfig = {
const DEFAULT_LANGUAGE_FROM: language = 'en';
// eslint-disable-next-line no-nested-ternary
const DEFAULT_BROWSER_LANGUAGE : language = (typeof window !== 'undefined') ? (
window?.navigator?.language.startsWith('zh')
window?.navigator?.language?.startsWith('zh')
? window?.navigator?.language as language
: window?.navigator?.language.split('-')[0] as language
: window?.navigator?.language?.split('-')[0] as language
) : 'en';

const DEFAULT_PROPS = {
Expand Down
Loading

0 comments on commit 16e0bd4

Please sign in to comment.