mirror of
https://github.com/heyman/heynote.git
synced 2024-11-21 15:33:14 +01:00
Check for updates once every 24 hours.
Bump version.
This commit is contained in:
parent
19dc637dee
commit
1df255032c
@ -10,3 +10,4 @@ export const UPDATE_DOWNLOAD_PROGRESS = "update-download-progress"
|
||||
|
||||
export const UPDATE_START_DOWNLOAD = "auto-update:startDownload"
|
||||
export const UPDATE_INSTALL_AND_RESTART = "auto-update:installAndRestart"
|
||||
export const UPDATE_CHECK_FOR_UPDATES = "auto-update:checkForUpdates"
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
UPDATE_ERROR,
|
||||
UPDATE_START_DOWNLOAD,
|
||||
UPDATE_INSTALL_AND_RESTART,
|
||||
UPDATE_CHECK_FOR_UPDATES,
|
||||
} from '../constants'
|
||||
|
||||
|
||||
@ -62,6 +63,10 @@ ipcMain.handle(UPDATE_INSTALL_AND_RESTART, () => {
|
||||
setImmediate(() => autoUpdater.quitAndInstall(true, true))
|
||||
})
|
||||
|
||||
ipcMain.handle(UPDATE_CHECK_FOR_UPDATES, () => {
|
||||
autoUpdater.checkForUpdates()
|
||||
})
|
||||
|
||||
export function checkForUpdates(win) {
|
||||
window = win
|
||||
|
||||
|
@ -13,6 +13,7 @@ import {
|
||||
UPDATE_START_DOWNLOAD,
|
||||
UPDATE_INSTALL_AND_RESTART,
|
||||
UPDATE_DOWNLOADED,
|
||||
UPDATE_CHECK_FOR_UPDATES,
|
||||
} from "../constants"
|
||||
import CONFIG from "../config"
|
||||
|
||||
@ -78,6 +79,9 @@ contextBridge.exposeInMainWorld("heynote", {
|
||||
installAndRestart() {
|
||||
ipcRenderer.invoke(UPDATE_INSTALL_AND_RESTART)
|
||||
},
|
||||
checkForUpdates() {
|
||||
ipcRenderer.invoke(UPDATE_CHECK_FOR_UPDATES)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Heynote",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"main": "dist-electron/main/index.js",
|
||||
"description": "A dedicated scratch pad",
|
||||
"author": "Jonatan Heyman (https://heyman.info)",
|
||||
|
@ -10,7 +10,9 @@
|
||||
transferred: 0.0,
|
||||
total: 0.0,
|
||||
bytesPerSecond: 0.0,
|
||||
}
|
||||
},
|
||||
|
||||
checkForUpdateIntervalId: null,
|
||||
}
|
||||
},
|
||||
|
||||
@ -39,7 +41,17 @@
|
||||
this.downloading = true
|
||||
this.updateProgress = progress
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
setInterval(() => {
|
||||
this.checkForUpdateIntervalId = window.heynote.autoUpdate.checkForUpdates()
|
||||
}, 1000 * 3600 * 24)
|
||||
},
|
||||
|
||||
beforeUnmount() {
|
||||
if (this.checkForUpdateIntervalId) {
|
||||
clearInterval(this.checkForUpdateIntervalId)
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
Loading…
Reference in New Issue
Block a user