From 8a37f9599ffd573bdc1f275dad6be9a824a60f42 Mon Sep 17 00:00:00 2001 From: Nicolas Gotchac Date: Mon, 13 Mar 2017 13:19:43 +0100 Subject: [PATCH] Reload UI on network switch (#4864) * Reload UI on network switch * Don't bither with timeout. --- js/src/redux/providers/chainMiddleware.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/src/redux/providers/chainMiddleware.js b/js/src/redux/providers/chainMiddleware.js index 3920eb7c3..2df40ed86 100644 --- a/js/src/redux/providers/chainMiddleware.js +++ b/js/src/redux/providers/chainMiddleware.js @@ -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({