Fix eslint errors

This commit is contained in:
Yuya Ochiai
2016-09-25 23:14:01 +09:00
parent 16a18e64e6
commit 16788b5a6f
21 changed files with 1282 additions and 1078 deletions

View File

@@ -9,7 +9,7 @@ const {
const path = require('path');
const fs = require('fs');
const allowedProtocolFile = path.resolve(app.getPath('userData'), 'allowedProtocols.json')
const allowedProtocolFile = path.resolve(app.getPath('userData'), 'allowedProtocols.json');
var allowedProtocols = [];
function init(mainWindow) {
@@ -41,22 +41,27 @@ function initDialogEvent(mainWindow) {
noLink: true
}, (response) => {
switch (response) {
case 1:
allowedProtocols.push(protocol);
fs.writeFile(allowedProtocolFile, JSON.stringify(allowedProtocols), (err) => {
if (err) console.error(err);
});
// fallthrough
case 0:
shell.openExternal(URL);
break;
default:
break;
case 1: {
allowedProtocols.push(protocol);
function handleError(err) {
if (err) {
console.error(err);
}
}
fs.writeFile(allowedProtocolFile, JSON.stringify(allowedProtocols), handleError);
shell.openExternal(URL);
break;
}
case 0:
shell.openExternal(URL);
break;
default:
break;
}
});
});
}
module.exports = {
init: init
init
};