Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Fix wrong network #381

Merged
merged 2 commits into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ matrix:
- if: branch =~ /^master$/ OR tag IS present
env: NODE_ENV=production
node_js: '8'
- if: NOT (branch =~ /^master$/)
- if: NOT (branch =~ /^master$/) AND NOT (tag IS present)
env: NODE_ENV=development
node_js: '9'
- if: NOT (branch =~ /^master$/)
- if: NOT (branch =~ /^master$/) AND NOT (tag IS present)
env: NODE_ENV=development
node_js: '8'
after_success:
Expand Down
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export const provider2SVG = (providerName: ProviderName | ProviderType) => {
}

export const web3CompatibleNetwork = async () => {
await windowLoaded
if (typeof window === 'undefined' || !window.web3) return 'UNKNOWN'

let netID
Expand All @@ -200,6 +201,7 @@ export const web3CompatibleNetwork = async () => {
})
} else {
// 0.2X.xx API
// without windowLoaded web3 can be injected but network id not yet set
netID = window.web3.version.network
}

Expand Down