From bf7527bd09e331da3f93e652134ed3e3e967390f Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Tue, 9 Oct 2018 10:54:07 +0200 Subject: [PATCH] Disable whole app on "window.onbeforeunload" event Disable whole react app to prevent future action processing. Fix: #116 --- src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 931e8c16..b3c6abc8 100644 --- a/src/index.js +++ b/src/index.js @@ -2,9 +2,7 @@ import React from 'react'; import { render } from 'react-dom'; import baseStyles from 'support/styles'; -import { onBeforeUnload } from 'actions/WalletActions'; import App from 'views/index'; -import store from './store'; const root: ?HTMLElement = document.getElementById('root'); if (root) { @@ -13,7 +11,8 @@ if (root) { } window.onbeforeunload = () => { - store.dispatch(onBeforeUnload()); + // $FlowIssue: render empty component + render(null, root); }; // Application life cycle starts in services/WalletService.js \ No newline at end of file