Show AviaClient version is tray, and expose it to world
This commit is contained in:
parent
0c2d23d029
commit
e56455fbaf
3 changed files with 15 additions and 6 deletions
|
|
@ -2,6 +2,7 @@
|
|||
"name": "stoat-desktop",
|
||||
"productName": "stoat-desktop",
|
||||
"version": "1.3.0",
|
||||
"aviaVersion": "1.6.0",
|
||||
"main": ".vite/build/main.js",
|
||||
"repository": "stoatchat/desktop",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Menu, Tray, app, nativeImage } from "electron";
|
|||
|
||||
import trayIconAsset from "../../avia_assets/icon.png?asset";
|
||||
import macOsTrayIconAsset from "../../avia_assets/iconTemplate.png?asset";
|
||||
import { version } from "../../package.json";
|
||||
import { aviaVersion, version } from "../../package.json";
|
||||
|
||||
import { config } from "./config";
|
||||
import { mainWindow, quitApp } from "./window";
|
||||
|
|
@ -30,7 +30,9 @@ export function initTray() {
|
|||
tray.setImage(trayIcon);
|
||||
tray.on("click", () => {
|
||||
config.sync();
|
||||
if (config.disableTrayClick) { return; }
|
||||
if (config.disableTrayClick) {
|
||||
return;
|
||||
}
|
||||
if (mainWindow.isVisible()) {
|
||||
mainWindow.hide();
|
||||
} else {
|
||||
|
|
@ -45,11 +47,16 @@ export function updateTrayMenu() {
|
|||
Menu.buildFromTemplate([
|
||||
{ label: "AviaClient for Desktop", type: "normal", enabled: false },
|
||||
{
|
||||
label: "Version",
|
||||
label: "Versions",
|
||||
type: "submenu",
|
||||
submenu: Menu.buildFromTemplate([
|
||||
{
|
||||
label: version,
|
||||
label: `Stoat Desktop: ${version}`,
|
||||
type: "normal",
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
label: `AviaClient: ${aviaVersion}`,
|
||||
type: "normal",
|
||||
enabled: false,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { contextBridge, ipcRenderer } from "electron";
|
||||
|
||||
import { version } from "../../package.json";
|
||||
import { aviaVersion, version } from "../../package.json";
|
||||
|
||||
contextBridge.exposeInMainWorld("native", {
|
||||
versions: {
|
||||
|
|
@ -8,6 +8,7 @@ contextBridge.exposeInMainWorld("native", {
|
|||
chrome: () => process.versions.chrome,
|
||||
electron: () => process.versions.electron,
|
||||
desktop: () => version,
|
||||
aviaClient: () => aviaVersion,
|
||||
},
|
||||
|
||||
minimise: () => ipcRenderer.send("minimise"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue