mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-16 05:48:10 +00:00
Communication with electron, Ref. #13
This commit is contained in:
23
sentry.js
23
sentry.js
@ -1,6 +1,8 @@
|
||||
const { SentryClient } = require('@sentry/electron');
|
||||
var fs = require('fs');
|
||||
const fs = require('fs');
|
||||
const { ipcMain } = require('electron');
|
||||
|
||||
let crashReportsEnabled = true;
|
||||
const DSN =
|
||||
'https://cb7b474b2e874afb8e400c47d1452ecc:7876224cbff543d992cb0ac4021962f8@sentry.io/1040940';
|
||||
|
||||
@ -8,8 +10,17 @@ const isDev = () => {
|
||||
return fs.existsSync('.git');
|
||||
};
|
||||
|
||||
if (!isDev()) {
|
||||
SentryClient.create({
|
||||
dsn: DSN
|
||||
});
|
||||
}
|
||||
const shouldSendCallback = () => {
|
||||
return !isDev() && crashReportsEnabled;
|
||||
};
|
||||
|
||||
|
||||
ipcMain.on('settings.changed', function (event, settings) {
|
||||
crashReportsEnabled = settings.crash_reports;
|
||||
});
|
||||
|
||||
|
||||
SentryClient.create({
|
||||
dsn: DSN,
|
||||
shouldSendCallback: shouldSendCallback
|
||||
});
|
||||
|
Reference in New Issue
Block a user