Reload UI on network switch (#4864)
* Reload UI on network switch * Don't bither with timeout.
This commit is contained in:
parent
fddbc9e5cb
commit
8a37f9599f
@ -29,7 +29,10 @@ export default class ChainMiddleware {
|
|||||||
const { nodeStatus } = store.getState();
|
const { nodeStatus } = store.getState();
|
||||||
|
|
||||||
if (newChain !== nodeStatus.netChain && nodeStatus.netChain !== DEFAULT_NETCHAIN) {
|
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
|
// Fetch the new balances without notifying the user of any change
|
||||||
BalancesProvider.get(store).fetchAllBalances({
|
BalancesProvider.get(store).fetchAllBalances({
|
||||||
|
Loading…
Reference in New Issue
Block a user