diff options
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/crypto.ts | 7 | ||||
-rw-r--r-- | src/platform/detection.ts | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/platform/crypto.ts b/src/platform/crypto.ts new file mode 100644 index 000000000..c7deb21cc --- /dev/null +++ b/src/platform/crypto.ts @@ -0,0 +1,7 @@ +// HACK +// expo-modules-core tries to require('crypto') in uuid.web.js +// and while it tries to detect web crypto before doing so, our +// build fails when it tries to do this require. We use a babel +// and tsconfig alias to direct it here +// -prf +export default crypto diff --git a/src/platform/detection.ts b/src/platform/detection.ts index f4f7be240..150fc1fe3 100644 --- a/src/platform/detection.ts +++ b/src/platform/detection.ts @@ -14,5 +14,7 @@ export const isMobileWeb = global.window.matchMedia(isMobileWebMediaQuery)?.matches export const deviceLocales = dedupArray( - getLocales?.().map?.(locale => locale.languageCode), -) + getLocales?.() + .map?.(locale => locale.languageCode) + .filter(code => typeof code === 'string'), +) as string[] |