2016-07-16 02:06:10 +00:00
|
|
|
import React from 'react';
|
2017-02-26 21:12:51 +00:00
|
|
|
import ReactDOM from 'react-dom';
|
2016-11-07 20:24:38 +00:00
|
|
|
import {Provider} from 'react-redux';
|
|
|
|
import {Tabs} from 'react-tabs';
|
2016-07-16 02:06:10 +00:00
|
|
|
import App from './containers/App';
|
2017-02-27 21:00:13 +00:00
|
|
|
import './css/index.less';
|
2016-11-16 17:18:39 +00:00
|
|
|
import {init as initStore} from './redux/modules';
|
|
|
|
import {init as initDB} from '../common/database';
|
|
|
|
import {init as initSync} from '../sync';
|
|
|
|
import {init as initAnalytics} from '../analytics';
|
2016-11-30 03:55:27 +00:00
|
|
|
import {types as modelTypes} from '../models';
|
|
|
|
import {getAccountId} from '../sync/session';
|
2016-03-16 05:49:42 +00:00
|
|
|
|
2016-04-26 07:29:24 +00:00
|
|
|
// Don't inject component styles (use our own)
|
|
|
|
Tabs.setUseDefaultStyles(false);
|
2016-04-16 23:24:57 +00:00
|
|
|
|
2016-10-02 20:57:00 +00:00
|
|
|
(async function () {
|
2016-11-30 03:55:27 +00:00
|
|
|
|
|
|
|
await initDB(modelTypes());
|
|
|
|
await initAnalytics(getAccountId());
|
|
|
|
|
|
|
|
// Create Redux store
|
|
|
|
const store = await initStore();
|
|
|
|
|
|
|
|
// Actually render the app
|
2017-02-26 21:12:51 +00:00
|
|
|
ReactDOM.render(
|
2016-10-02 20:57:00 +00:00
|
|
|
<Provider store={store}><App /></Provider>,
|
|
|
|
document.getElementById('root')
|
|
|
|
);
|
2016-11-30 03:55:27 +00:00
|
|
|
|
|
|
|
// Do things that can wait
|
|
|
|
process.nextTick(initSync);
|
2016-10-02 20:57:00 +00:00
|
|
|
})();
|
2016-11-30 03:55:27 +00:00
|
|
|
|