Add version information to update notification
This commit is contained in:
parent
5e7598689a
commit
75fb74f9e3
|
|
@ -2,7 +2,7 @@ import { app, shell, BrowserWindow, ipcMain, Notification } from 'electron'
|
|||
import { join } from 'path'
|
||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||
import icon from '../../resources/icon.png?asset'
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
import { autoUpdater, UpdateInfo } from 'electron-updater'
|
||||
import Store from './lib/Store'
|
||||
import { registerToastTarget, showErrorToast, showSuccessToast, showToast } from './lib/Toast'
|
||||
|
||||
|
|
@ -166,8 +166,8 @@ function checkForUpdates() {
|
|||
}
|
||||
|
||||
/*New Update Available*/
|
||||
autoUpdater.on("update-available", () => {
|
||||
console.log(`Update available. Current version ${app.getVersion()}`);
|
||||
autoUpdater.on("update-available", (info: UpdateInfo) => {
|
||||
console.log(`Update available. Current version ${app.getVersion()}`, info.version);
|
||||
showToast(`Update available. Current version ${app.getVersion()}`);
|
||||
showNotification(`Update available. Current version ${app.getVersion()}`);
|
||||
let pth = autoUpdater.downloadUpdate();
|
||||
|
|
@ -176,10 +176,10 @@ autoUpdater.on("update-available", () => {
|
|||
showNotification(`Download update path : ${pth}`);
|
||||
});
|
||||
|
||||
autoUpdater.on("update-not-available", () => {
|
||||
console.log(`No update available. Current version ${app.getVersion()}`);
|
||||
showToast(`No update available. Current version ${app.getVersion()}`);
|
||||
showNotification(`No update available. Current version ${app.getVersion()}`);
|
||||
autoUpdater.on("update-not-available", (info: UpdateInfo) => {
|
||||
console.log(`No update available. Current version ${app.getVersion()}`, info.version);
|
||||
showToast(`No update available. Current version ${app.getVersion()}, ${info.version}`);
|
||||
showNotification(`No update available. Current version ${app.getVersion()}, ${info.version}`);
|
||||
});
|
||||
|
||||
/*Download Completion Message*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue