mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 01:11:13 -06:00
1. Crash Details such as Company Name and Crashpad URL are now being fetched from the global config file.
This commit is contained in:
parent
65b08f0952
commit
abdd8da1fa
@ -1,6 +1,10 @@
|
||||
{
|
||||
"url": "https://foundation-dev.symphony.com",
|
||||
"sendCrashReports": true,
|
||||
"crashReporterDetails": {
|
||||
"backendURL": "http://crash.symphony.com/",
|
||||
"sendCrashReports": true,
|
||||
"autoSubmit": true
|
||||
},
|
||||
"minimizeOnClose" : true,
|
||||
"launchOnStartup" : true
|
||||
}
|
@ -1,24 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
const electron = require('electron');
|
||||
const {crashReporter} = require('electron');
|
||||
const {app} = process.type === 'browser' ? electron : electron.remote;
|
||||
|
||||
/**
|
||||
* Setup the crash reporter with appropriate information
|
||||
* @param sendCrashReports: An object to get crash information
|
||||
* @param crashReporterDetails: An object to get crash information
|
||||
* from the global config file
|
||||
* @param detailObj: An object to send extra parameters
|
||||
* via the crash reporter
|
||||
*/
|
||||
function setupCrashReporter(detailObj, sendCrashReports) {
|
||||
// Will eventually have to fetch all these from the config file.
|
||||
let crashReportInfo = {
|
||||
companyName: "Symphony Communication Services, LLC",
|
||||
submitURL: "http://crash.symphony.com",
|
||||
autoSubmit: true,
|
||||
uploadToServer: sendCrashReports,
|
||||
extra: detailObj
|
||||
function setupCrashReporter(detailObj, crashReporterDetails) {
|
||||
|
||||
// Fetch details from config file
|
||||
if (!crashReporterDetails){
|
||||
return
|
||||
}
|
||||
|
||||
let crashReportInfo = {
|
||||
companyName: app.getName(),
|
||||
submitURL: crashReporterDetails.backendURL,
|
||||
autoSubmit: crashReporterDetails.autoSubmit,
|
||||
uploadToServer: crashReporterDetails.sendCrashReports,
|
||||
extra: detailObj
|
||||
};
|
||||
|
||||
// App store builds cannot use crash reporter, so, return if that's the case
|
||||
if (process.platform === 'darwin' && process.mas) {
|
||||
return
|
||||
|
@ -167,7 +167,7 @@ function createWin(urlFromConfig) {
|
||||
* Get crash info from global config and setup crash reporter for Main Process.
|
||||
*/
|
||||
function initializeCrashReporter () {
|
||||
getConfigField('sendCrashReports').then(
|
||||
getConfigField('crashReporterDetails').then(
|
||||
function (data) {
|
||||
crashReporter.setupCrashReporter({'window': 'main'}, data);
|
||||
}
|
||||
|
@ -34,7 +34,12 @@ const throttledSetBadgeCount = throttle(1000, function(count) {
|
||||
});
|
||||
|
||||
// Setup the crash reporter
|
||||
crashReporter.setupCrashReporter({'window': 'preloadMain'});
|
||||
var demoData = {
|
||||
"backendURL": "http://localhost:1127/post",
|
||||
"sendCrashReports": true,
|
||||
"autoSubmit": true
|
||||
};
|
||||
crashReporter.setupCrashReporter({'window': 'preloadMain'}, demoData);
|
||||
|
||||
createAPI();
|
||||
|
||||
|
@ -75,7 +75,7 @@ function doCreateMainWindow(initialUrl, initialBounds) {
|
||||
/**
|
||||
* Get crash info from global config and setup crash reporter.
|
||||
*/
|
||||
getConfigField('sendCrashReports').then(
|
||||
getConfigField('crashReporterDetails').then(
|
||||
function (data) {
|
||||
crashReporter.setupCrashReporter({'window': 'main'}, data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user