Skip to content

Build your personal knowledge base with Trilium Notes

fix(transcription): keep the stop button while a recording outlasts the switch

Elian Doran98bebe76ccd0
diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
index 7b3269ea9e..eb4a00b8b4 100644
--- a/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.spec.tsx
@@ -233,6 +233,16 @@ describe("RecordMeetingButton", () => {
expect(container.querySelector("button")).toBeNull();
});
+ it("keeps the stop button while a recording outlasts turning transcription off", async () => {
+ mocks.transcriptionEnabled = false;
+ for (const status of [ "starting", "recording", "stopping" ] as const) {
+ const container = await renderWithState({ status, noteId: "meeting" });
+ expect(container?.querySelector(".record-meeting-launcher button"), status)
+ .not.toBeNull();
+ }
+ window.electronApi = undefined;
+ });
+
it("marks the launcher as beta", () => {
const container = renderInto(<RecordMeetingButton launcherNote={{} as FNote} />);
expect(container.querySelector(".record-meeting-launcher .record-meeting-beta-badge")?.textContent)
diff --git a/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
index 381dbd67ac..940742e213 100644
--- a/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
+++ b/apps/client/src/widgets/launch_bar/RecordMeetingButton.tsx
@@ -51,7 +51,8 @@ export default function RecordMeetingButton({ launcherNote }: LauncherNoteProps)
return () => clearInterval(interval);
}, [ status ]);
- if (!isEnabled) {
+ // A recording outlives the switch turning off, so its stop button stays until it ends.
+ if (!isEnabled && status === "idle") {
return null;
}