Skip to content

Commit

Permalink
don't overwrite window.crypto if not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Jan 23, 2017
1 parent e6e4e08 commit 81fd8bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down

0 comments on commit 81fd8bf

Please sign in to comment.