Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(app): split the update check's permanent and transient vetoes

Claude04274381177a
diff --git a/electron/main.ts b/electron/main.ts
index e7e70da09..c671ba3d8 100644
--- a/electron/main.ts
+++ b/electron/main.ts
@@ -39,7 +39,7 @@ import {
unregisterAllGlobalShortcuts,
} from "./globalShortcut";
import { mainT, setMainLocale } from "./i18n";
-import { getInstallChannel, offersUpdateCheck } from "./install-channel";
+import { getInstallChannel, offersUpdateCheck, platformOwnsUpdates } from "./install-channel";
import { getSelectedDesktopSource, registerIpcHandlers } from "./ipc/handlers";
import { installMainProcessErrorGuards } from "./main-process-errors";
import { registerSttIpc, shutdownStt } from "./stt";
@@ -412,6 +412,15 @@ function canOfferUpdateCheck(): boolean {
return offersUpdateCheck(getInstallChannel(), { recording: isRecording });
}
+/** What the HUD is told at mount, and only the permanent half of the veto. The recording half
+ * is transient and the renderer already knows whether it is recording, so folding it into a
+ * once-per-mount answer would strand the button off for the rest of a HUD that happened to
+ * mount mid-take — and the HUD is rebuilt for every recording. The renderer applies the
+ * transient half itself; `check-for-updates` still enforces both. */
+function channelAllowsUpdateCheck(): boolean {
+ return !platformOwnsUpdates(getInstallChannel());
+}
+
/** Message boxes must be owned by a window. The HUD is `alwaysOnTop` and `skipTaskbar`
* (electron/windows.ts), so an unowned dialog opens *behind* it on Windows and most Linux
* WMs, with no taskbar entry to recover it — the user sees a button flash and nothing else.
@@ -1003,7 +1012,7 @@ appReady?.then(async () => {
// CLI boot path and in a losing second instance that is on its way to app.quit().
ipcMain.handle("get-app-info", () => ({
version: app.getVersion(),
- canCheckForUpdates: canOfferUpdateCheck(),
+ canCheckForUpdates: channelAllowsUpdateCheck(),
}));
ipcMain.handle("check-for-updates", async () => {
diff --git a/src/components/launch/LaunchWindow.test.tsx b/src/components/launch/LaunchWindow.test.tsx
index cbf02921e..e777dbec4 100644
--- a/src/components/launch/LaunchWindow.test.tsx
+++ b/src/components/launch/LaunchWindow.test.tsx
@@ -927,6 +927,28 @@ describe("LaunchWindow device settings", () => {
expect(recorderState.value.setMicrophoneEnabled).not.toHaveBeenCalled();
});
+ // The gear is disabled while recording, but a panel that was already open stays mounted —
+ // and the main process refuses the check for the length of a take. Offering the button then
+ // would give the user a click that does nothing at all: no dialog, no error, no feedback.
+ it("withdraws the update check when a recording starts under an open panel", async () => {
+ const { rerender } = renderLaunchWindow();
+
+ fireEvent.click(await screen.findByTestId("launch-device-settings-button"));
+ const panel = await screen.findByTestId("hud-device-settings");
+ expect(await within(panel).findByTestId("hud-check-for-updates")).toBeInTheDocument();
+
+ recorderState.value.recording = true;
+ rerender(
+ <TooltipProvider>
+ <LaunchWindow />
+ </TooltipProvider>,
+ );
+
+ // The version stays: "what am I running" is exactly the question a take does not change.
+ expect(within(panel).queryByTestId("hud-check-for-updates")).not.toBeInTheDocument();
+ expect(within(panel).getByText("Version 1.9.6")).toBeInTheDocument();
+ });
+
it("is unavailable while recording, when devices can't be changed anyway", async () => {
recorderState.value.recording = true;
diff --git a/src/components/launch/LaunchWindow.tsx b/src/components/launch/LaunchWindow.tsx
index a1fe8a284..8b3e9f26d 100644
--- a/src/components/launch/LaunchWindow.tsx
+++ b/src/components/launch/LaunchWindow.tsx
@@ -1092,7 +1092,11 @@ export function LaunchWindow() {
cameraError={cameraDevicesError}
labels={deviceSettingsLabels}
versionLabel={versionLabel}
- canCheckForUpdates={appInfo?.canCheckForUpdates ?? false}
+ // `canCheckForUpdates` is the install channel's answer, fixed for the
+ // process. The recording veto is applied here because the gear is
+ // disabled mid-take but a panel already open stays mounted, and the
+ // main process refuses the check then — an offered button would be dead.
+ canCheckForUpdates={(appInfo?.canCheckForUpdates ?? false) && !recording}
checkingForUpdates={isCheckingForUpdates}
onSelectMic={handleSelectMicDevice}
onSelectCamera={handleSelectCameraDevice}