Skip to content

Commit 81fd8bf

Browse files
committed
don't overwrite window.crypto if not necessary
1 parent e6e4e08 commit 81fd8bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

shim.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ if (require('./package.json').dependencies['react-native-crypto']) {
3434

3535
let crypto
3636
if (typeof window === 'object') {
37-
crypto = window.crypto = window.crypto || {}
37+
if (!window.crypto) window.crypto = {}
38+
crypto = window.crypto
3839
} else {
3940
crypto = require('crypto')
4041
}

0 commit comments

Comments
 (0)