mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
autoupgrade status
This commit is contained in:
@@ -287,6 +287,10 @@ ipcMain.handle('openExternal', async (event, url) => {
|
|||||||
});
|
});
|
||||||
ipcMain.handle('downloadUpdate', async (event, url) => {
|
ipcMain.handle('downloadUpdate', async (event, url) => {
|
||||||
autoUpdater.downloadUpdate();
|
autoUpdater.downloadUpdate();
|
||||||
|
changeAppUpdateStatus({
|
||||||
|
icon: 'icon loading',
|
||||||
|
message: `Downloading update...`,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
ipcMain.on('applyUpdate', async (event, url) => {
|
ipcMain.on('applyUpdate', async (event, url) => {
|
||||||
autoUpdater.quitAndInstall(false, true);
|
autoUpdater.quitAndInstall(false, true);
|
||||||
@@ -473,12 +477,17 @@ autoUpdater.on('checking-for-update', () => {
|
|||||||
|
|
||||||
autoUpdater.on('update-available', info => {
|
autoUpdater.on('update-available', info => {
|
||||||
console.log('Update available', info);
|
console.log('Update available', info);
|
||||||
|
if (autoUpdater.autoDownload) {
|
||||||
|
changeAppUpdateStatus({
|
||||||
|
icon: 'icon loading',
|
||||||
|
message: `Downloading update...`,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
mainWindow.webContents.send('update-available', info.version);
|
||||||
changeAppUpdateStatus({
|
changeAppUpdateStatus({
|
||||||
icon: 'icon download',
|
icon: 'icon download',
|
||||||
message: `New version ${info.version} available`,
|
message: `New version ${info.version} available`,
|
||||||
});
|
});
|
||||||
if (!autoUpdater.autoDownload) {
|
|
||||||
mainWindow.webContents.send('update-available', info.version);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user