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 { join } from 'path'
|
||||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||||
import icon from '../../resources/icon.png?asset'
|
import icon from '../../resources/icon.png?asset'
|
||||||
import { autoUpdater } from 'electron-updater'
|
import { autoUpdater, UpdateInfo } from 'electron-updater'
|
||||||
import Store from './lib/Store'
|
import Store from './lib/Store'
|
||||||
import { registerToastTarget, showErrorToast, showSuccessToast, showToast } from './lib/Toast'
|
import { registerToastTarget, showErrorToast, showSuccessToast, showToast } from './lib/Toast'
|
||||||
|
|
||||||
|
|
@ -166,8 +166,8 @@ function checkForUpdates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*New Update Available*/
|
/*New Update Available*/
|
||||||
autoUpdater.on("update-available", () => {
|
autoUpdater.on("update-available", (info: UpdateInfo) => {
|
||||||
console.log(`Update available. Current version ${app.getVersion()}`);
|
console.log(`Update available. Current version ${app.getVersion()}`, info.version);
|
||||||
showToast(`Update available. Current version ${app.getVersion()}`);
|
showToast(`Update available. Current version ${app.getVersion()}`);
|
||||||
showNotification(`Update available. Current version ${app.getVersion()}`);
|
showNotification(`Update available. Current version ${app.getVersion()}`);
|
||||||
let pth = autoUpdater.downloadUpdate();
|
let pth = autoUpdater.downloadUpdate();
|
||||||
|
|
@ -176,10 +176,10 @@ autoUpdater.on("update-available", () => {
|
||||||
showNotification(`Download update path : ${pth}`);
|
showNotification(`Download update path : ${pth}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
autoUpdater.on("update-not-available", () => {
|
autoUpdater.on("update-not-available", (info: UpdateInfo) => {
|
||||||
console.log(`No update available. Current version ${app.getVersion()}`);
|
console.log(`No update available. Current version ${app.getVersion()}`, info.version);
|
||||||
showToast(`No update available. Current version ${app.getVersion()}`);
|
showToast(`No update available. Current version ${app.getVersion()}, ${info.version}`);
|
||||||
showNotification(`No update available. Current version ${app.getVersion()}`);
|
showNotification(`No update available. Current version ${app.getVersion()}, ${info.version}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*Download Completion Message*/
|
/*Download Completion Message*/
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue