mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
refactor(auto-updater): remove native install dialog and streamline update notification handling
This commit is contained in:
parent
c0fefa4db1
commit
6cf0f07366
1 changed files with 1 additions and 18 deletions
|
|
@ -70,23 +70,6 @@ function notifyRenderersUpdateDownloaded(info: UpdateInfo): void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function showNativeInstallDialog(autoUpdater: AutoUpdater, info: UpdateInfo): Promise<void> {
|
|
||||||
const { response } = await dialog.showMessageBox({
|
|
||||||
type: 'info',
|
|
||||||
buttons: ['Restart', 'Later'],
|
|
||||||
defaultId: 0,
|
|
||||||
title: 'Update Ready',
|
|
||||||
message: `Version ${info.version} has been downloaded. Restart to apply the update.`,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response === 0) {
|
|
||||||
trackEvent('desktop_update_install_accepted', { new_version: info.version });
|
|
||||||
autoUpdater.quitAndInstall();
|
|
||||||
} else {
|
|
||||||
trackEvent('desktop_update_install_deferred', { new_version: info.version });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function installDownloadedUpdate(): void {
|
export function installDownloadedUpdate(): void {
|
||||||
const autoUpdater = getAutoUpdater();
|
const autoUpdater = getAutoUpdater();
|
||||||
trackEvent('desktop_update_install_accepted', { source: 'renderer_prompt' });
|
trackEvent('desktop_update_install_accepted', { source: 'renderer_prompt' });
|
||||||
|
|
@ -154,7 +137,7 @@ export async function checkForUpdatesManually(): Promise<void> {
|
||||||
};
|
};
|
||||||
const onDownloaded = (info: UpdateInfo) => {
|
const onDownloaded = (info: UpdateInfo) => {
|
||||||
cleanup();
|
cleanup();
|
||||||
void showNativeInstallDialog(autoUpdater, info);
|
notifyRenderersUpdateDownloaded(info);
|
||||||
resolve('downloaded');
|
resolve('downloaded');
|
||||||
};
|
};
|
||||||
const onError = (err: Error) => {
|
const onError = (err: Error) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue