Display app version in the title.

This commit is contained in:
Mikunj 2019-06-19 10:01:04 +10:00
parent 8530a7f834
commit 7408ece55f
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { app, ipcMain, BrowserWindow, Menu, dialog } from "electron"
import { version, productName } from "../../package.json"
import { Backend } from "./modules/backend"
import menuTemplate from "./menu"
import isDev from "electron-is-dev"
@ -20,6 +21,8 @@ let mainWindow, backend
let showConfirmClose = true
let forceQuit = false
const title = `${productName} v${version}`
const selectionMenu = Menu.buildFromTemplate([
{ role: "copy" },
{ type: "separator" },
@ -51,7 +54,8 @@ function createWindow () {
height: mainWindowState.height,
minWidth: 640,
minHeight: 480,
icon: require("path").join(__statics, "icon_512x512.png")
icon: require("path").join(__statics, "icon_512x512.png"),
title
})
mainWindow.on("close", (e) => {
@ -96,6 +100,9 @@ function createWindow () {
})
mainWindow.webContents.on("did-finish-load", () => {
// Set the title
mainWindow.setTitle(title)
require("crypto").randomBytes(64, (err, buffer) => {
// if err, then we may have to use insecure token generation perhaps
if (err) throw err