Skip to content
Open
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
16 changes: 12 additions & 4 deletions apps/desktop/src/routes/target-select-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,12 @@ function Inner() {
onRecordingStart={() => {
setOriginalCameraBounds(null);
if (options.mode === "screenshot") {
// The window variant has always dismissed the picker
// for screenshots too; keep that, tagged as such.
// Only mark the dismissal here. takeScreenshot is
// invoked from THIS webview right after, and closing
Comment thread
oshtz marked this conversation as resolved.
// destroys the webview before the invoke is dispatched,
// so the screenshot silently never happens. The start
// handler hides these windows and closes them once the
// capture is done.
if (options.targetModeSource === "editor") {
setOptions({
targetMode: null,
Expand All @@ -708,7 +712,6 @@ function Inner() {
targetModeDismissal: "screenshot",
Comment thread
oshtz marked this conversation as resolved.
});
}
commands.closeTargetSelectOverlays();
} else {
dismissPickerForRecordingStart();
}
Expand Down Expand Up @@ -2005,11 +2008,16 @@ function RecordingControls(props: {
if (shouldOpenEditor) {
await commands.showWindow({ ScreenshotEditor: { path } });
}
await commands.closeTargetSelectOverlays();
} catch (e) {
const message = e instanceof Error ? e.message : String(e);
toast.error(`Failed to take screenshot: ${message}`);
console.error("Failed to take screenshot", e);
} finally {
await commands
.closeTargetSelectOverlays()
.catch((e) =>
console.error("Failed to close target select overlays", e),
);
}
return;
}
Expand Down