Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions electron/electron-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ interface Window {
message?: string;
error?: string;
}>;
/** Returns the app version from package.json */
getAppVersion: () => Promise<string>;
/** Hide the OS cursor before browser capture starts. */
hideOsCursor: () => Promise<{ success: boolean }>;
/** Countdown timer before recording */
Expand Down
4 changes: 4 additions & 0 deletions electron/ipc/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4441,5 +4441,9 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
seconds: countdownInProgress ? countdownRemaining : null,
}
})

ipcMain.handle('app:getVersion', () => {
return app.getVersion()
})
}

1 change: 1 addition & 0 deletions electron/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ contextBridge.exposeInMainWorld("electronAPI", {
isNativeWindowsCaptureAvailable: () => ipcRenderer.invoke("is-native-windows-capture-available"),
muxNativeWindowsRecording: () => ipcRenderer.invoke("mux-native-windows-recording"),
hideOsCursor: () => ipcRenderer.invoke("hide-cursor"),
getAppVersion: () => ipcRenderer.invoke("app:getVersion"),
getCountdownDelay: () => ipcRenderer.invoke("get-countdown-delay"),
setCountdownDelay: (delay: number) => ipcRenderer.invoke("set-countdown-delay", delay),
startCountdown: (seconds: number) => ipcRenderer.invoke("start-countdown", seconds),
Expand Down
31 changes: 31 additions & 0 deletions src/components/launch/LaunchWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export function LaunchWindow() {
const [sourcesLoading, setSourcesLoading] = useState(false);
const [hideHudFromCapture, setHideHudFromCapture] = useState(true);
const [platform, setPlatform] = useState<string | null>(null);
const [appVersion, setAppVersion] = useState<string | null>(null);
const dropdownRef = useRef<HTMLDivElement>(null);
const hudContentRef = useRef<HTMLDivElement>(null);
const hudBarRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -368,6 +369,22 @@ export function LaunchWindow() {
};
}, []);

useEffect(() => {
let cancelled = false;
const loadVersion = async () => {
try {
const version = await window.electronAPI.getAppVersion();
if (!cancelled) setAppVersion(version);
} catch (error) {
console.error("Failed to load app version:", error);
}
};
void loadVersion();
return () => {
cancelled = true;
};
}, []);

useEffect(() => {
let cancelled = false;
const loadHudCaptureProtection = async () => {
Expand Down Expand Up @@ -1002,6 +1019,20 @@ export function LaunchWindow() {
{LOCALE_LABELS[code] ?? code}
</DropdownItem>
))}
{appVersion && (
<div
style={{
marginTop: 8,
padding: "4px 12px",
fontSize: 11,
color: "#6b6b78",
textAlign: "center",
userSelect: "text",
}}
>
v{appVersion}
</div>
)}
</>
)}
</div>
Expand Down