Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(editor): add platform-specific existing recording picker options

Richie McIlroy1d5783dc53a0
diff --git a/apps/desktop/src/routes/editor/existing-recording-picker.ts b/apps/desktop/src/routes/editor/existing-recording-picker.ts
new file mode 100644
index 000000000..5c443399d
--- /dev/null
+++ b/apps/desktop/src/routes/editor/existing-recording-picker.ts
@@ -0,0 +1,21 @@
+import type { OpenDialogOptions } from "@tauri-apps/plugin-dialog";
+import type { OsType } from "@tauri-apps/plugin-os";
+
+export const getExistingRecordingPickerOptions = (
+ platform: OsType,
+ defaultPath: string,
+): OpenDialogOptions => {
+ if (platform === "windows") {
+ return {
+ defaultPath,
+ directory: true,
+ multiple: false,
+ };
+ }
+
+ return {
+ defaultPath,
+ filters: [{ name: "Cap Recording", extensions: ["cap"] }],
+ multiple: false,
+ };
+};