From 81fd8bf49a6db6c968ef40452a907eb2bda5cb02 Mon Sep 17 00:00:00 2001 From: Mark Vayngrib Date: Mon, 23 Jan 2017 14:45:55 -0500 Subject: [PATCH] don't overwrite window.crypto if not necessary --- shim.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shim.js b/shim.js index 5f28b72..6e7f184 100644 --- a/shim.js +++ b/shim.js @@ -34,7 +34,8 @@ if (require('./package.json').dependencies['react-native-crypto']) { let crypto if (typeof window === 'object') { - crypto = window.crypto = window.crypto || {} + if (!window.crypto) window.crypto = {} + crypto = window.crypto } else { crypto = require('crypto') }