Fix the client version in the about modal (#315)

The client version in the about modal was hard-coded. Now, it will use
the same values that powered the Electron about modal.
This commit is contained in:
Evan Simkowitz 2024-09-03 21:45:44 -07:00 committed by GitHub
parent f252531197
commit 0de41fab08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 5 deletions

View File

@ -200,10 +200,6 @@ function runWaveSrv(): Promise<boolean> {
process.env[WebServerEndpointVarName] = startParams[2];
WaveVersion = startParams[3];
WaveBuildTime = parseInt(startParams[4]);
electron.app.setAboutPanelOptions({
applicationVersion: "v" + WaveVersion,
version: (isDev ? "dev-" : "") + String(WaveBuildTime),
});
waveSrvReadyResolve(true);
return;
}
@ -599,6 +595,10 @@ electron.ipcMain.on("get-env", (event, varName) => {
event.returnValue = process.env[varName] ?? null;
});
electron.ipcMain.on("get-about-modal-details", (event) => {
event.returnValue = { version: WaveVersion, buildTime: WaveBuildTime } as AboutModalDetails;
});
const hasBeforeInputRegisteredMap = new Map<number, boolean>();
electron.ipcMain.on("webview-focus", (event: Electron.IpcMainEvent, focusedId: number) => {

View File

@ -9,6 +9,7 @@ contextBridge.exposeInMainWorld("api", {
getPlatform: () => ipcRenderer.sendSync("get-platform"),
getCursorPoint: () => ipcRenderer.sendSync("get-cursor-point"),
getUserName: () => ipcRenderer.sendSync("get-user-name"),
getAboutModalDetails: () => ipcRenderer.sendSync("get-about-modal-details"),
openNewWindow: () => ipcRenderer.send("open-new-window"),
showContextMenu: (menu, position) => ipcRenderer.send("contextmenu-show", menu, position),
onContextMenuClick: (callback) => ipcRenderer.on("contextmenu-click", (_event, id) => callback(id)),

View File

@ -6,12 +6,16 @@ import { LinkButton } from "@/app/element/linkbutton";
import { modalsModel } from "@/app/store/modalmodel";
import { Modal } from "./modal";
import { isDev } from "@/util/isdev";
import { useState } from "react";
import { getApi } from "../store/global";
import "./about.less";
interface AboutModalProps {}
const AboutModal = ({}: AboutModalProps) => {
const currentDate = new Date();
const [details] = useState(() => getApi().getAboutModalDetails());
return (
<Modal className="about-modal" onClose={() => modalsModel.popModal()}>
@ -25,7 +29,10 @@ const AboutModal = ({}: AboutModalProps) => {
Built for Seamless Workflows
</div>
</div>
<div className="section text-standard">Client Version 0.1.8 (20240615-002636)</div>
<div className="section text-standard">
Client Version {details.version} ({isDev() ? "dev-" : ""}
{details.buildTime})
</div>
<div className="section">
<LinkButton
className="secondary solid"

View File

@ -54,6 +54,7 @@ declare global {
getPlatform: () => NodeJS.Platform;
getEnv: (varName: string) => string;
getUserName: () => string;
getAboutModalDetails: () => AboutModalDetails;
showContextMenu: (menu?: ElectronContextMenuItem[]) => void;
onContextMenuClick: (callback: (id: string) => void) => void;
onNavigate: (callback: (url: string) => void) => void;
@ -234,6 +235,11 @@ declare global {
}
type TypeAheadModalType = { [key: string]: boolean };
interface AboutModalDetails {
version: string;
buildTime: number;
}
}
export {};