Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop): open recording folder by mode in target and settings

Richie McIlroy943ec9876ba8
diff --git a/apps/desktop/src/routes/(window-chrome)/new-main/TargetCard.tsx b/apps/desktop/src/routes/(window-chrome)/new-main/TargetCard.tsx
index 34798d53d..effcd5d53 100644
--- a/apps/desktop/src/routes/(window-chrome)/new-main/TargetCard.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/new-main/TargetCard.tsx
@@ -8,6 +8,7 @@ import type { ComponentProps } from "solid-js";
import { createMemo, createSignal, Show, splitProps } from "solid-js";
import toast from "solid-toast";
import Tooltip from "~/components/Tooltip";
+import { openRecordingFolder } from "~/utils/recording";
import {
type CaptureDisplayWithThumbnail,
type CaptureWindowWithThumbnail,
@@ -272,7 +273,10 @@ export default function TargetCard(props: TargetCardProps) {
e.stopPropagation();
const recording = recordingTarget();
if (!recording) return;
- commands.openFilePath(recording.path);
+ openRecordingFolder(recording.path, recording.mode).catch((error) => {
+ console.error("Failed to open recording folder:", error);
+ toast.error("Failed to open folder");
+ });
};
const handleDeleteRecording = async (e: MouseEvent) => {
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
index b26eb60c9..e4b91d0a7 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
@@ -25,6 +25,7 @@ import CapTooltip from "~/components/Tooltip";
import { Input } from "~/routes/editor/ui";
import { trackEvent } from "~/utils/analytics";
import { createTauriEventListener } from "~/utils/createEventListener";
+import { openRecordingFolder } from "~/utils/recording";
import {
commands,
events,
@@ -166,9 +167,11 @@ export default function Recordings() {
events.newStudioRecordingAdded.emit({ path: recording.path });
};
- const handleOpenFolder = (path: string) => {
+ const handleOpenFolder = (recording: Recording) => {
trackEvent("recording_folder_clicked");
- commands.openFilePath(path);
+ openRecordingFolder(recording.path, recording.meta.mode).catch((error) => {
+ console.error("Failed to open recording folder:", error);
+ });
};
const handleCopyVideoToClipboard = (path: string) => {
@@ -253,7 +256,7 @@ export default function Recordings() {
<RecordingItem
recording={recording}
onClick={() => handleRecordingClick(recording)}
- onOpenFolder={() => handleOpenFolder(recording.path)}
+ onOpenFolder={() => handleOpenFolder(recording)}
onOpenEditor={() => handleOpenEditor(recording.path)}
onCopyVideoToClipboard={() =>
handleCopyVideoToClipboard(recording.path)