fix(developers): Avoid recreate shortcut and enabling Sentry in development mode.

This commit is contained in:
Quentin Decaunes 2019-08-16 12:37:57 +02:00
parent 22554b41dc
commit 32e94d7fc2
2 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,9 @@ ready(function(){
const settings = require('electron-settings'); const settings = require('electron-settings');
const fixPath = require('fix-path'); const fixPath = require('fix-path');
document.isStarting = true; document.isStarting = true;
if (isDevMode()) {
addSentry(); addSentry();
}
fixPath(); fixPath();
displayOptions(); displayOptions();
preFillSettings(); preFillSettings();
@ -13,7 +15,7 @@ ready(function(){
checkForAdminRights(); checkForAdminRights();
displayVersion(); displayVersion();
reApplyPeriodically(require('electron-settings').get('settings.reapply_periodically')); reApplyPeriodically(require('electron-settings').get('settings.reapply_periodically'));
if (require('os').platform() === 'win32') { if (require('os').platform() === 'win32' && isDevMode()) {
recreateShortcut(); recreateShortcut();
} }
handlePlatformSpecificDisplay(); handlePlatformSpecificDisplay();

View File

@ -656,3 +656,10 @@ function updateScheduledStartOnBoot(toBeEnabled) {
} }
}); });
} }
/**
* Return true if dev mode.
*/
function isDevMode() {
return require('electron').remote.app.isPackaged;
}