mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-18 12:46:23 +00:00
28 lines
574 B
JavaScript
28 lines
574 B
JavaScript
const { init } = require('@sentry/electron');
|
|
const fs = require('fs');
|
|
|
|
const { ipcMain } = require('electron')
|
|
|
|
let crashReportsEnabled = true;
|
|
const DSN =
|
|
'https://cb7b474b2e874afb8e400c47d1452ecc:7876224cbff543d992cb0ac4021962f8@sentry.io/1040940';
|
|
|
|
const isDev = () => {
|
|
return fs.existsSync('.git');
|
|
};
|
|
|
|
const shouldSendCallback = () => {
|
|
return !isDev() && crashReportsEnabled;
|
|
};
|
|
|
|
|
|
ipcMain.on('settings.changed', function (event, settings) {
|
|
crashReportsEnabled = settings.crash_reports;
|
|
});
|
|
|
|
|
|
init({
|
|
dsn: DSN,
|
|
shouldSendCallback: shouldSendCallback
|
|
});
|