bnc-assist
Advanced tools
Comparing version 0.6.1 to 0.6.2
{ | ||
"name": "bnc-assist", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Blocknative Assist js library for Dapp developers", | ||
@@ -5,0 +5,0 @@ "main": "lib/assist.min.js", |
@@ -46,3 +46,3 @@ # Assist.js | ||
The library uses [semantic versioning](https://semver.org/spec/v2.0.0.html). | ||
The current version is 0.6.1. | ||
The current version is 0.6.2. | ||
There are minified and non-minified versions. | ||
@@ -52,7 +52,7 @@ Put this script at the top of your `<head>` | ||
```html | ||
<script src="https://assist.blocknative.com/0-6-1/assist.js"></script> | ||
<script src="https://assist.blocknative.com/0-6-2/assist.js"></script> | ||
<!-- OR... --> | ||
<script src="https://assist.blocknative.com/0-6-1/assist.min.js"></script> | ||
<script src="https://assist.blocknative.com/0-6-2/assist.min.js"></script> | ||
``` | ||
@@ -59,0 +59,0 @@ |
@@ -106,3 +106,7 @@ import { promisify } from 'bluebird' | ||
if (web3.version.api && typeof web3.version.api === 'string') { | ||
if ( | ||
web3.version && | ||
web3.version.api && | ||
typeof web3.version.api === 'string' | ||
) { | ||
legacyWeb3 = true | ||
@@ -131,3 +135,3 @@ modernWeb3 = false | ||
export function checkForWallet() { | ||
if (window.ethereum) { | ||
if (window.ethereum && window.web3.version) { | ||
updateState({ | ||
@@ -140,3 +144,3 @@ currentProvider: getCurrentProvider(), | ||
}) | ||
} else if (window.web3) { | ||
} else if (window.web3 && window.web3.version) { | ||
updateState({ | ||
@@ -265,3 +269,7 @@ currentProvider: getCurrentProvider(), | ||
export function checkUnlocked() { | ||
return window.ethereum._metamask.isUnlocked() | ||
return ( | ||
window.ethereum && | ||
window.ethereum._metamask && | ||
window.ethereum._metamask.isUnlocked() | ||
) | ||
} | ||
@@ -268,0 +276,0 @@ |
@@ -222,5 +222,3 @@ import { state, updateState } from '~/js/helpers/state' | ||
} else { | ||
const loggedIn = state.modernWallet | ||
? await checkUnlocked().catch(resolve) | ||
: false | ||
const loggedIn = state.modernWallet ? await checkUnlocked() : false | ||
@@ -227,0 +225,0 @@ updateState({ |
Sorry, the diff of this file is too big to display
1862454
8027