|
@@ -13,22 +13,24 @@ const BrowserWindow = electron.BrowserWindow;
|
|
const checkDialout = require("./back-end/checkDialout");
|
|
const checkDialout = require("./back-end/checkDialout");
|
|
|
|
|
|
|
|
|
|
-var mainWindow = null;
|
|
+let mainWindow = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-app.on('window-all-closed', function() {
|
|
+app.on('window-all-closed', () => {
|
|
|
|
|
|
|
|
|
|
- if (process.platform != 'darwin') {
|
|
+ if (process.platform !== 'darwin') {
|
|
app.quit();
|
|
app.quit();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-var launchApp = function() {
|
|
+function launchApp() {
|
|
-
|
|
+
|
|
- mainWindow.loadURL('file://' + __dirname + '/front-end/index.html');
|
|
+ mainWindow.webContents.session.clearCache(() => {
|
|
-
|
|
+
|
|
|
|
+ mainWindow.loadURL('file://' + __dirname + '/front-end/index.html');
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
function launchLinuxHelper() {
|
|
function launchLinuxHelper() {
|
|
@@ -38,7 +40,7 @@ function launchLinuxHelper() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-app.on('ready', function() {
|
|
+app.on('ready', function () {
|
|
|
|
|
|
mainWindow = new BrowserWindow({
|
|
mainWindow = new BrowserWindow({
|
|
width: 520,
|
|
width: 520,
|
|
@@ -48,23 +50,23 @@ app.on('ready', function() {
|
|
'accept-first-mouse': true
|
|
'accept-first-mouse': true
|
|
});
|
|
});
|
|
|
|
|
|
- if(process.platform === "linux") {
|
|
+ if (process.platform === "linux") {
|
|
- checkDialout(launchApp, (err) => {
|
|
+ checkDialout(launchApp, (err) => {
|
|
- if(err.message === checkDialout.ERROR_MESSAGES.USER_NOT_IN_DIALOUT) {
|
|
+ if (err.message === checkDialout.ERROR_MESSAGES.USER_NOT_IN_DIALOUT) {
|
|
- launchLinuxHelper();
|
|
+ launchLinuxHelper();
|
|
- } else {
|
|
+ } else {
|
|
-
|
|
+
|
|
- launchApp();
|
|
+ launchApp();
|
|
- }
|
|
+ }
|
|
- });
|
|
+ });
|
|
} else {
|
|
} else {
|
|
- launchApp();
|
|
+ launchApp();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- mainWindow.on('closed', function() {
|
|
+ mainWindow.on('closed', () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -86,17 +88,17 @@ function handleSquirrelEvent() {
|
|
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
|
|
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
|
|
const exeName = path.basename(process.execPath);
|
|
const exeName = path.basename(process.execPath);
|
|
|
|
|
|
- const spawn = function(command, args) {
|
|
+ const spawn = function (command, args) {
|
|
let spawnedProcess, error;
|
|
let spawnedProcess, error;
|
|
|
|
|
|
try {
|
|
try {
|
|
- spawnedProcess = ChildProcess.spawn(command, args, {detached: true});
|
|
+ spawnedProcess = ChildProcess.spawn(command, args, { detached: true });
|
|
- } catch (error) {}
|
|
+ } catch (error) { }
|
|
|
|
|
|
return spawnedProcess;
|
|
return spawnedProcess;
|
|
};
|
|
};
|
|
|
|
|
|
- const spawnUpdate = function(args) {
|
|
+ const spawnUpdate = function (args) {
|
|
return spawn(updateDotExe, args);
|
|
return spawn(updateDotExe, args);
|
|
};
|
|
};
|
|
|
|
|