1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 12:59:09 +00:00
trezor-wallet/src/index.js
Szymon Lesisz bf7527bd09 Disable whole app on "window.onbeforeunload" event
Disable whole react app to prevent future action processing.
Fix: #116
2018-10-09 10:54:07 +02:00

18 lines
431 B
JavaScript

/* @flow */
import React from 'react';
import { render } from 'react-dom';
import baseStyles from 'support/styles';
import App from 'views/index';
const root: ?HTMLElement = document.getElementById('root');
if (root) {
baseStyles();
render(<App />, root);
}
window.onbeforeunload = () => {
// $FlowIssue: render empty component
render(null, root);
};
// Application life cycle starts in services/WalletService.js