From c66383ddbae6e23e1fb0d4a71b1349a57c85335b Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Mon, 26 Nov 2018 09:34:31 +0100 Subject: [PATCH] disable BlockchainActions for non-ethereum networks --- src/actions/BlockchainActions.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions/BlockchainActions.js b/src/actions/BlockchainActions.js index 978bf43b..9a43bb6e 100644 --- a/src/actions/BlockchainActions.js +++ b/src/actions/BlockchainActions.js @@ -93,6 +93,7 @@ export const onBlockMined = (coinInfo: any): PromiseAction => async (dispa // incoming "coinInfo" from TrezorConnect is CoinInfo | EthereumNetwork type const network: string = coinInfo.shortcut.toLowerCase(); + if (network !== 'ethereum') return; // try to resolve pending transactions await dispatch(Web3Actions.resolvePendingTransactions(network)); @@ -175,8 +176,11 @@ export const subscribe = (network: string): PromiseAction => async (dispat accounts: [], coin: network, }); - // init web3 instance if not exists - await dispatch(Web3Actions.initWeb3(network)); + + if (network === 'ethereum') { + // init web3 instance if not exists + await dispatch(Web3Actions.initWeb3(network)); + } }; // Conditionally subscribe to blockchain backend