1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-30 19:00:53 +00:00

disable BlockchainActions for non-ethereum networks

This commit is contained in:
Szymon Lesisz 2018-11-26 09:34:31 +01:00
parent 0918403024
commit c66383ddba

View File

@ -93,6 +93,7 @@ export const onBlockMined = (coinInfo: any): PromiseAction<void> => 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<void> => 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