Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { AppContainer } from 'react-hot-loader';
import Raven from 'raven-js';
import { ipcRenderer } from 'electron';
import App from './containers/App';
import store from './store';
import './assets/stylesheets/main.less';
import pjson from '../package.json';
require('smoothscroll-polyfill').polyfill();
Raven.addPlugin(require('./raven-electron-plugin')); // eslint-disable-line
if (process.env.UPLOAD_SENTRY !== '0') {
if (process.env.SENTRY_LINK) {
Raven
.config(process.env.SENTRY_LINK, {
release: `${pjson.version}_${process.platform}`,
})
.install();
}
}
window.onerror = (...argw) => {
ipcRenderer.send('errorInWindow', argw);
};
render(
// Generate DSN
if (!_options.dsn || !_options.dsn.length) {
_options.dsn = `${_options.protocol}://${_options.public_key}` +
`:${_options.private_key}@${_options.host}${_options.path}${_options.project_id}`
}
// Public DSN (without private key)
if (!_options.public_dsn || !_options.public_dsn.length) {
_options.public_dsn = _options.dsn.replace(/:\w+@/, '@')
}
// config raven
Raven.config(_options.dsn, _options.config)
if (!_options.disableAutoReport) {
Raven.addPlugin(RavenVue, Vue)
}
// install Raven
Raven.install()
// add raven instance
Vue.prototype.$raven = Raven
}
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import Raven from 'raven-js';
import { ipcRenderer as ipc } from 'electron';
import { useSentry, sentryUrl, sendQuitRequest } from 'config';
import Base from './components/Base/Base';
import store from './store';
import { appQuitRequest } from './actions/ui';
import pjson from './package.json';
import './app.global.css';
Raven.addPlugin(require('./raven-electron-plugin')); // eslint-disable-line
if (useSentry) {
Raven
.config(sentryUrl, {
release: `${pjson.version}_${process.platform}`,
})
.install();
}
window.onerror = (...argw) => {
ipc.send('errorInWindow', argw);
};
render(
,
install() {
// we have to remove the sampleRate if native client is available
// otherwise we will sample twice
if (Sentry.isNativeClientAvailable() && this.options.sampleRate !== undefined) {
Raven._globalOptions.sampleRate = 1;
}
Raven.install();
Raven.addPlugin(
require('./raven-plugin'),
{
nativeClientAvailable: Sentry.isNativeClientAvailable(),
handlePromiseRejection: this.options.handlePromiseRejection
},
data => {
if (Sentry.options.internal) {
data.dist = Sentry.options.internal.dist;
}
}
);
if (Sentry.isNativeClientAvailable()) {
// We overwrite the default transport handler when the native
// client is available, because we want to send the event with native
Raven.setTransport(transportOptions => {