Skip to content

Commit 1a59456

Browse files
committed
Use electron-updater instead of update-electron-app
1 parent cbb66f4 commit 1a59456

File tree

3 files changed

+102
-43
lines changed

3 files changed

+102
-43
lines changed

electron/watchers/wakatime.ts

+14-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { MonitoringManager } from "../helpers/monitoring-manager";
1212
import { PropertiesManager } from "../helpers/properties-manager";
1313
import { SettingsManager } from "../helpers/settings-manager";
1414
import { WindowInfo } from "@miniben90/x-win";
15-
import { updateElectronApp } from "update-electron-app";
15+
import { autoUpdater } from "electron-updater";
1616

1717
export class Wakatime {
1818
private lastEntitiy = "";
@@ -36,15 +36,20 @@ export class Wakatime {
3636
this.tray = tray;
3737

3838
if (PropertiesManager.autoUpdateEnabled) {
39-
updateElectronApp({
40-
logger: {
41-
log: (message) => Logging.instance().log(message, LogLevel.DEBUG),
42-
error: (message) => Logging.instance().log(message, LogLevel.ERROR),
43-
info: (message) => Logging.instance().log(message, LogLevel.INFO),
44-
warn: (message) => Logging.instance().log(message, LogLevel.WARN),
45-
},
46-
updateInterval: "10 minutes",
39+
autoUpdater.checkForUpdatesAndNotify();
40+
/*
41+
autoUpdater.on("update-available", () => {
42+
console.log("Update available");
4743
});
44+
45+
autoUpdater.on("update-downloaded", () => {
46+
autoUpdater.quitAndInstall();
47+
});
48+
49+
app.on("ready", () => {
50+
autoUpdater.checkForUpdatesAndNotify();
51+
});
52+
*/
4853
}
4954

5055
if (PropertiesManager.shouldLogToFile) {

package-lock.json

+86-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"clsx": "^2.1.1",
3232
"date-fns": "^3.6.0",
3333
"electron-store": "^10.0.0",
34+
"electron-updater": "^6.3.9",
3435
"globals": "^15.9.0",
3536
"icon-promise": "^1.1.1",
3637
"iconutil": "^1.0.2",
@@ -43,7 +44,6 @@
4344
"tailwind-merge": "^2.5.2",
4445
"tailwindcss-animate": "^1.0.7",
4546
"unzipper": "^0.12.3",
46-
"update-electron-app": "^3.0.0",
4747
"usehooks-ts": "^3.1.0",
4848
"winreg": "^1.2.5",
4949
"zod": "^3.23.8"
@@ -79,4 +79,4 @@
7979
"vite-plugin-native": "^2.2.1"
8080
},
8181
"main": "dist-electron/main.js"
82-
}
82+
}

0 commit comments

Comments
 (0)