responsively-app/desktop-app/app/index.js

53 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-09-08 14:13:18 +00:00
require('dotenv').config();
2019-08-10 02:47:13 +00:00
import React from 'react';
2019-09-05 17:29:33 +00:00
import {remote} from 'electron';
2019-08-27 16:58:05 +00:00
import {render} from 'react-dom';
import {AppContainer} from 'react-hot-loader';
2019-08-10 02:47:13 +00:00
import Root from './containers/Root';
2019-08-27 16:58:05 +00:00
import {configureStore, history} from './store/configureStore';
2019-08-10 02:47:13 +00:00
import './app.global.css';
2019-09-05 17:29:33 +00:00
import * as Sentry from '@sentry/electron';
2019-08-10 02:47:13 +00:00
if (remote.getGlobal('process').env.NODE_ENV !== 'development') {
2020-03-14 08:05:02 +00:00
Sentry.init({
dsn: 'https://f2cdbc6a88aa4a068a738d4e4cfd3e12@sentry.io/1553155',
environment: remote.getGlobal('process').env.NODE_ENV,
beforeSend: (event, hint) => {
if (
hint &&
hint.originalException &&
2020-05-17 11:09:53 +00:00
(hint.originalException.message || '').indexOf(') loading ') > -1
) {
return null;
}
2020-05-17 16:08:54 +00:00
event.tags = {appVersion: remote.app.getVersion()};
return event;
},
2020-03-14 08:05:02 +00:00
});
}
2020-05-23 10:27:37 +00:00
window.heap &&
window.heap.addUserProperties({appVersion: remote.app.getVersion()});
2019-08-10 02:47:13 +00:00
const store = configureStore();
render(
2020-03-14 08:05:02 +00:00
<AppContainer>
<Root store={store} history={history} />
</AppContainer>,
document.getElementById('root')
2019-08-10 02:47:13 +00:00
);
if (module.hot) {
2020-03-14 08:05:02 +00:00
module.hot.accept('./containers/Root', () => {
// eslint-disable-next-line global-require
const NextRoot = require('./containers/Root').default;
render(
<AppContainer>
<NextRoot store={store} history={history} />
</AppContainer>,
document.getElementById('root')
);
});
2019-08-10 02:47:13 +00:00
}