Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix open from finder for good

Brendan Allan848b3f384b84
diff --git a/apps/desktop/src-tauri/src/deeplink_actions.rs b/apps/desktop/src-tauri/src/deeplink_actions.rs
index 8f84b5dc1..c71e4d1c2 100644
--- a/apps/desktop/src-tauri/src/deeplink_actions.rs
+++ b/apps/desktop/src-tauri/src/deeplink_actions.rs
@@ -1,8 +1,9 @@
-use std::path::Path;
+use std::path::{Path, PathBuf};
use cap_recording::RecordingMode;
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Manager, Url};
+use tracing::trace;
use crate::{
App, ArcLock, camera::CameraPreview, recording::StartRecordingInputs, windows::ShowCapWindow,
@@ -27,7 +28,7 @@ pub enum DeepLinkAction {
},
StopRecording,
OpenEditor {
- project_path: String,
+ project_path: PathBuf,
},
OpenSettings {
page: Option<String>,
@@ -35,8 +36,7 @@ pub enum DeepLinkAction {
}
pub fn handle(app_handle: &AppHandle, urls: Vec<Url>) {
- #[cfg(debug_assertions)]
- println!("Handling deep actions for: {:?}", &urls);
+ trace!("Handling deep actions for: {:?}", &urls);
let actions: Vec<_> = urls
.into_iter()
@@ -81,9 +81,10 @@ impl TryFrom<&Url> for DeepLinkAction {
type Error = ActionParseFromUrlError;
fn try_from(url: &Url) -> Result<Self, Self::Error> {
+ #[cfg(target_os = "macos")]
if url.scheme() == "file" {
return Ok(Self::OpenEditor {
- project_path: url.path().into(),
+ project_path: url.to_file_path().unwrap(),
});
}
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index fa53796f3..833728eb7 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -1988,13 +1988,13 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
.typ::<general_settings::GeneralSettingsStore>()
.typ::<cap_flags::Flags>();
- #[cfg(debug_assertions)]
- specta_builder
- .export(
- specta_typescript::Typescript::default(),
- "../src/utils/tauri.ts",
- )
- .expect("Failed to export typescript bindings");
+ // #[cfg(debug_assertions)]
+ // specta_builder
+ // .export(
+ // specta_typescript::Typescript::default(),
+ // "../src/utils/tauri.ts",
+ // )
+ // .expect("Failed to export typescript bindings");
let (camera_tx, camera_ws_port, _shutdown) = camera_legacy::create_camera_preview_ws().await;