Skip to content

Commit

Permalink
version 0.8.8 (#276)
Browse files Browse the repository at this point in the history
* add dapper to getCurrentProvider (#269)

* add dapper to getCurrentProvider

* Refined provider checking

* Check for undefined or null instead of just falsey value in result (#274)

* update to version 0.8.8
  • Loading branch information
cmeisl authored Jun 13, 2019
1 parent 6708145 commit 38dac6f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ yarn add bnc-assist
#### Script Tag

The library uses [semantic versioning](https://semver.org/spec/v2.0.0.html).
The current version is 0.8.7.
The current version is 0.8.8.
There are minified and non-minified versions.
Put this script at the top of your `<head>`

```html
<script src="https://assist.blocknative.com/0-8-7/assist.js"></script>
<script src="https://assist.blocknative.com/0-8-8/assist.js"></script>

<!-- OR... -->

<script src="https://assist.blocknative.com/0-8-7/assist.min.js"></script>
<script src="https://assist.blocknative.com/0-8-8/assist.min.js"></script>
```

### Initialize the Library
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bnc-assist",
"version": "0.8.7",
"version": "0.8.8",
"description": "Blocknative Assist js library for Dapp developers",
"main": "lib/assist.min.js",
"scripts": {
Expand Down
9 changes: 8 additions & 1 deletion src/js/helpers/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,17 @@ export function requestLoginEnable() {
}

export function getCurrentProvider() {
const web3 = state.web3Instance || window.web3
const web3 = state.web3Instance

if (!web3) {
return 'unknown'
}
if (web3.currentProvider.isMetaMask) {
return 'metamask'
}
if (web3.currentProvider.isDapper) {
return 'dapper'
}
if (web3.currentProvider.isTrust) {
return 'trust'
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/logic/contract-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function modernCall(method, name, args) {
handleError({ resolve, reject, callback })(errorObj)
})

if (result) {
if (result != null) {
handleEvent({
eventCode: 'contractQuery',
categoryCode: 'activeContract',
Expand Down

0 comments on commit 38dac6f

Please sign in to comment.