mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Add version to the title
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "imgfloat-electron",
|
"name": "imgfloat-electron",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "imgfloat-electron",
|
"name": "imgfloat-electron",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-updater": "^6.6.2"
|
"electron-updater": "^6.6.2"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ function onPostNavigationLoad(win, url, broadcastRect) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow(version) {
|
||||||
const win = new BrowserWindow({
|
const win = new BrowserWindow({
|
||||||
width: initialWindowWidthPx,
|
width: initialWindowWidthPx,
|
||||||
height: initialWindowHeightPx,
|
height: initialWindowHeightPx,
|
||||||
@@ -83,6 +83,7 @@ function createWindow() {
|
|||||||
webPreferences: { backgroundThrottling: false },
|
webPreferences: { backgroundThrottling: false },
|
||||||
});
|
});
|
||||||
win.setMenu(null);
|
win.setMenu(null);
|
||||||
|
win.setTitle(`Imgfloat Client v${version}`);
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
@@ -98,10 +99,12 @@ app.whenReady().then(() => {
|
|||||||
autoUpdater.checkForUpdatesAndNotify();
|
autoUpdater.checkForUpdatesAndNotify();
|
||||||
|
|
||||||
let broadcastRect = { width: 0, height: 0 };
|
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.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-finish-load", () => onPostNavigationLoad(win, undefined, broadcastRect));
|
||||||
win.webContents.on("did-navigate", (_, url) => onPostNavigationLoad(win, url, broadcastRect));
|
win.webContents.on("did-navigate", (_, url) => onPostNavigationLoad(win, url, broadcastRect));
|
||||||
win.webContents.on("did-navigate-in-page", (_, 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);
|
win.on("closed", clearCanvasSizeInterval);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user