Clean logs on start - and eslint/mocha with code coverage (#1945)
* Clean logs on startup; install server-side testing/linting * Add eslint config, make all of app/ conform to its demands * Add Node.js testing and linting to CI * Lock project to Node.js 7.9.0, used by Electron 1.7.10 * New eslint error: trailing commas in function argumensts Node 7.9.0 doesn't like trailing commas, but Electron does * Move electron to devDependency, tell eslint it's built-in
This commit is contained in:
parent
6464d0a5fa
commit
64fe9dbfb2
21 changed files with 1782 additions and 316 deletions
|
@ -1,4 +1,4 @@
|
|||
const autoUpdater = require('electron-updater').autoUpdater
|
||||
const { autoUpdater } = require('electron-updater');
|
||||
const { dialog } = require('electron');
|
||||
|
||||
const config = require('./config');
|
||||
|
@ -18,7 +18,7 @@ function checkForUpdates() {
|
|||
autoUpdater.checkForUpdates();
|
||||
}
|
||||
|
||||
var showingDialog = false;
|
||||
let showingDialog = false;
|
||||
function showUpdateDialog(mainWindow, messages) {
|
||||
if (showingDialog) {
|
||||
return;
|
||||
|
@ -29,21 +29,21 @@ function showUpdateDialog(mainWindow, messages) {
|
|||
type: 'info',
|
||||
buttons: [
|
||||
messages.autoUpdateRestartButtonLabel.message,
|
||||
messages.autoUpdateLaterButtonLabel.message
|
||||
messages.autoUpdateLaterButtonLabel.message,
|
||||
],
|
||||
title: messages.autoUpdateNewVersionTitle.message,
|
||||
message: messages.autoUpdateNewVersionMessage.message,
|
||||
detail: messages.autoUpdateNewVersionInstructions.message,
|
||||
defaultId: LATER_BUTTON,
|
||||
cancelId: RESTART_BUTTON,
|
||||
}
|
||||
};
|
||||
|
||||
dialog.showMessageBox(mainWindow, options, function(response) {
|
||||
if (response == RESTART_BUTTON) {
|
||||
dialog.showMessageBox(mainWindow, options, (response) => {
|
||||
if (response === RESTART_BUTTON) {
|
||||
// We delay these update calls because they don't seem to work in this
|
||||
// callback - but only if the message box has a parent window.
|
||||
// Fixes this bug: https://github.com/WhisperSystems/Signal-Desktop/issues/1864
|
||||
setTimeout(function() {
|
||||
setTimeout(() => {
|
||||
windowState.markShouldQuit();
|
||||
autoUpdater.quitAndInstall();
|
||||
}, 200);
|
||||
|
@ -54,7 +54,7 @@ function showUpdateDialog(mainWindow, messages) {
|
|||
}
|
||||
|
||||
function onError(error) {
|
||||
console.log("Got an error while updating: ", error.stack);
|
||||
console.log('Got an error while updating: ', error.stack);
|
||||
}
|
||||
|
||||
function initialize(getMainWindow, messages) {
|
||||
|
@ -66,7 +66,7 @@ function initialize(getMainWindow, messages) {
|
|||
return;
|
||||
}
|
||||
|
||||
autoUpdater.addListener('update-downloaded', function() {
|
||||
autoUpdater.addListener('update-downloaded', () => {
|
||||
showUpdateDialog(getMainWindow(), messages);
|
||||
});
|
||||
autoUpdater.addListener('error', onError);
|
||||
|
@ -77,5 +77,5 @@ function initialize(getMainWindow, messages) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
initialize
|
||||
initialize,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue