Reload UI on network switch (#4864)

* Reload UI on network switch

* Don't bither with timeout.
This commit is contained in:
Nicolas Gotchac 2017-03-13 13:19:43 +01:00 committed by Jaco Greeff
parent fddbc9e5cb
commit 8a37f9599f

View File

@ -29,7 +29,10 @@ export default class ChainMiddleware {
const { nodeStatus } = store.getState();
if (newChain !== nodeStatus.netChain && nodeStatus.netChain !== DEFAULT_NETCHAIN) {
store.dispatch(showSnackbar(`Switched to ${newChain}. Please reload the page.`, 60000));
store.dispatch(showSnackbar(`Switched to ${newChain}. The UI will reload now...`));
setTimeout(() => {
window.location.reload();
}, 0);
// Fetch the new balances without notifying the user of any change
BalancesProvider.get(store).fetchAllBalances({