1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 12:59:09 +00:00
trezor-wallet/src/js/index.js

26 lines
615 B
JavaScript
Raw Normal View History

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';
import { onBeforeUnload } from './actions/WalletActions';
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();
}