2017-12-13 11:01:37 +00:00
|
|
|
/* @flow */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { render } from 'react-dom';
|
2018-02-20 09:30:36 +00:00
|
|
|
import store from './store';
|
2017-12-13 11:01:37 +00:00
|
|
|
import router from './router';
|
2018-04-11 10:06:46 +00:00
|
|
|
import { onBeforeUnload } from './actions/WalletActions';
|
2018-05-18 16:26:45 +00:00
|
|
|
import styles from '~/styles/index.less';
|
2017-12-13 11:01:37 +00:00
|
|
|
|
2018-04-16 21:19:50 +00:00
|
|
|
const root: ?HTMLElement = document.getElementById('root');
|
|
|
|
if (root) {
|
|
|
|
render(router, root);
|
|
|
|
}
|
2017-12-13 11:01:37 +00:00
|
|
|
|
2018-02-20 09:30:36 +00:00
|
|
|
window.onbeforeunload = () => {
|
|
|
|
store.dispatch( onBeforeUnload() );
|
|
|
|
}
|
|
|
|
|
2018-05-11 19:01:43 +00:00
|
|
|
// workaround for web3
|
2018-05-17 20:08:34 +00:00
|
|
|
// yarn add web3@^0.19.0
|
|
|
|
//if (module && module.hot)
|
|
|
|
if (typeof module !== undefined && module.hasOwnProperty('hot')) {
|
|
|
|
// $FlowIssue
|
|
|
|
module.hot.accept();
|
|
|
|
}
|