Add version to the title

This commit is contained in:
2026-01-06 03:05:03 +01:00
parent 97ebe81399
commit 7e8e3d63ef
2 changed files with 7 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "imgfloat-electron",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "imgfloat-electron",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"electron-updater": "^6.6.2"
},

View File

@@ -71,7 +71,7 @@ function onPostNavigationLoad(win, url, broadcastRect) {
}
}
function createWindow() {
function createWindow(version) {
const win = new BrowserWindow({
width: initialWindowWidthPx,
height: initialWindowHeightPx,
@@ -83,6 +83,7 @@ function createWindow() {
webPreferences: { backgroundThrottling: false },
});
win.setMenu(null);
win.setTitle(`Imgfloat Client v${version}`);
return win;
}
@@ -98,10 +99,12 @@ app.whenReady().then(() => {
autoUpdater.checkForUpdatesAndNotify();
let broadcastRect = { width: 0, height: 0 };
const win = createWindow();
const version = app.getVersion();
const win = createWindow(version);
win.loadURL(process.env["IMGFLOAT_CHANNELS_URL"] || "https://imgfloat.kruhlmann.dev/channels");
win.webContents.on("did-finish-load", () => onPostNavigationLoad(win, undefined, broadcastRect));
win.webContents.on("did-navigate", (_, url) => onPostNavigationLoad(win, url, broadcastRect));
win.webContents.on("did-navigate-in-page", (_, url) => onPostNavigationLoad(win, url, broadcastRect));
win.on("page-title-updated", (e) => e.preventDefault());
win.on("closed", clearCanvasSizeInterval);
});