Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Reload UI on network switch #4864

Merged
merged 2 commits into from
Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/src/redux/providers/chainMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down