From 9125186590846d5127dc3164ad0fc85687b906ea Mon Sep 17 00:00:00 2001 From: Max Berman Date: Mon, 20 Jan 2020 10:19:10 +0100 Subject: [PATCH] wip --- client/.env.example | 2 +- client/src/components/molecules/NetworkSwitcher.tsx | 2 +- client/src/components/organisms/Web3message.tsx | 2 ++ client/src/context/UserProvider.tsx | 6 +++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/.env.example b/client/.env.example index a4db6d4..97e1e94 100644 --- a/client/.env.example +++ b/client/.env.example @@ -9,7 +9,7 @@ # This env var is a shortcut for a set of Ocean network component endpoints. # # Possible values: pacific, nile, duero, spree -REACT_APP_OCEAN_NETWORK=spree +REACT_APP_OCEAN_NETWORK=pacific # # APP CONFIG diff --git a/client/src/components/molecules/NetworkSwitcher.tsx b/client/src/components/molecules/NetworkSwitcher.tsx index abf8945..5c46c8c 100644 --- a/client/src/components/molecules/NetworkSwitcher.tsx +++ b/client/src/components/molecules/NetworkSwitcher.tsx @@ -43,7 +43,7 @@ export function NetworkSwitcher() { return } - return !isBurner ? null : ( + return (
{ private Message = () => { const { networkMatch, network } = this.context + console.log(networkMatch) + return ( {user => ( diff --git a/client/src/context/UserProvider.tsx b/client/src/context/UserProvider.tsx index 68d7083..8f331a0 100644 --- a/client/src/context/UserProvider.tsx +++ b/client/src/context/UserProvider.tsx @@ -82,6 +82,8 @@ export default class UserProvider extends PureComponent<{}, UserProviderState> { const metamaskProvider = new MetamaskProvider() await metamaskProvider.startLogin() const web3 = metamaskProvider.getProvider() + console.log(web3.currentProvider) + console.log(web3) this.setState( { isLogged: true, @@ -260,7 +262,9 @@ export default class UserProvider extends PureComponent<{}, UserProviderState> { if (ocean.keeper) { network = await ocean.keeper.getNetworkName() } - network !== this.state.network && this.setState({ network }) + if (network !== this.state.network) { + this.setState({ network }) + } console.log(await ocean.keeper.getNetworkName()) }