From 860fb300eafc07248f05094f4afed2df2923b45a Mon Sep 17 00:00:00 2001 From: apanizo Date: Thu, 7 Jun 2018 22:43:52 +0200 Subject: [PATCH] WA-234 Provisional metamask safety check --- src/wallets/getWeb3.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallets/getWeb3.js b/src/wallets/getWeb3.js index 5e9602c5..8b5e43d3 100644 --- a/src/wallets/getWeb3.js +++ b/src/wallets/getWeb3.js @@ -5,7 +5,7 @@ import type { ProviderProps } from '~/wallets/store/model/provider' import { promisify } from '~/utils/promisify' let web3 -export const getWeb3 = () => web3 +export const getWeb3 = () => web3 || new Web3(window.web3.currentProvider) const isMetamask: Function = (web3Provider): boolean => { const isMetamaskConstructor = web3Provider.currentProvider.constructor.name === 'MetamaskInpageProvider'