1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -36,8 +36,9 @@ const updater = new GhReleases(ghReleasesOpts)
// Check for updates
// `status` returns true if there is a new update available
function checkUpdate () {
if (!isPackaged) { // Prevents app from attempting to update when in dev mode.
function checkUpdate() {
if (!isPackaged) {
// Prevents app from attempting to update when in dev mode.
console.log('Updates are disabled in Development mode, see main-app.js')
return true
}
@@ -58,29 +59,29 @@ function checkUpdate () {
})
}
updater.on('update-downloaded', (info) => {
updater.on('update-downloaded', info => {
if (mainWindow != null) {
mainWindow.webContents.send('update-ready', 'Update available!')
isUpdateReady = true
}
})
updater.autoUpdater.on('error', (err) => {
updater.autoUpdater.on('error', err => {
console.error(err)
})
ipc.on('update-app-confirm', function (event, msg) {
ipc.on('update-app-confirm', function(event, msg) {
if (isUpdateReady) {
mainWindow.removeAllListeners()
updater.install()
}
})
app.on('window-all-closed', function () {
app.on('window-all-closed', function() {
app.quit()
})
app.on('ready', function () {
app.on('ready', function() {
mainWindow = require('./main-window')
var template = require('./main-menu')
@@ -100,7 +101,7 @@ app.on('ready', function () {
}
// Check update every day
setInterval(function () {
setInterval(function() {
if (isPackaged) checkUpdate()
}, 1000 * 60 * 60 * 24)
@@ -108,7 +109,7 @@ app.on('ready', function () {
setTimeout(() => {
if (isPackaged) checkUpdate()
ipc.on('update-check', function (event, msg) {
ipc.on('update-check', function(event, msg) {
if (isUpdateReady) {
mainWindow.webContents.send('update-ready', 'Update available!')
} else {