Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Make sentry optional

Ilyaa7519bc93f2b
diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs
index a3015ec8f..b29c71dcd 100644
--- a/apps/desktop/src-tauri/src/main.rs
+++ b/apps/desktop/src-tauri/src/main.rs
@@ -3,29 +3,41 @@
use std::sync::Arc;
-#[tokio::main]
-async fn main() {
- let _guard = sentry::init((
- env!("CAP_DESKTOP_SENTRY_URL"),
- sentry::ClientOptions {
- release: sentry::release_name!(),
- debug: cfg!(debug_assertions),
- before_send: Some(Arc::new(|mut event| {
- #[cfg(debug_assertions)]
- return None;
+fn main() {
+ // We have to hold onto the ClientInitGuard until the very end
+ let _guard = match std::env::var("CAP_DESKTOP_SENTRY_URL") {
+ Ok(sentry_url) => Some(sentry::init((
+ sentry_url,
+ sentry::ClientOptions {
+ release: sentry::release_name!(),
+ debug: cfg!(debug_assertions),
+ before_send: Some(Arc::new(|event| {
+ #[cfg(debug_assertions)]
+ {
+ let msg = event.message.clone().unwrap_or("No message".into());
+ println!("Sentry captured {}: {}", &event.level, &msg);
+ Some(event)
+ }
- #[cfg(not(debug_assertions))]
- {
- Some(event)
- }
- })),
- ..Default::default()
- },
- ));
+ #[cfg(not(debug_assertions))]
+ {
+ Some(event)
+ }
+ })),
+ ..Default::default()
+ },
+ ))),
+ Err(_) => {
+ tracing::warn!(
+ "Sentry URL not found in environment variables, skipping Sentry initialization"
+ );
+ None
+ }
+ };
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.expect("Failed to build multi threaded tokio runtime")
- .block_on(desktop_solid_lib::run);
+ .block_on(desktop_solid_lib::run());
}
diff --git a/packages/ui-solid/src/auto-imports.d.ts b/packages/ui-solid/src/auto-imports.d.ts
index c458e30d6..c3d0793cb 100644
--- a/packages/ui-solid/src/auto-imports.d.ts
+++ b/packages/ui-solid/src/auto-imports.d.ts
@@ -6,6 +6,7 @@
// biome-ignore lint: disable
export {}
declare global {
+ const IconCapArrows: typeof import('~icons/cap/arrows.jsx')['default']
const IconCapAudioOn: typeof import('~icons/cap/audio-on.jsx')['default']
const IconCapBlur: typeof import('~icons/cap/blur.jsx')['default']
const IconCapCamera: typeof import('~icons/cap/camera.jsx')['default']
@@ -39,6 +40,7 @@ declare global {
const IconCapScissors: typeof import('~icons/cap/scissors.jsx')['default']
const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default']
const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default']
+ const IconCapSquare: typeof import('~icons/cap/square.jsx')['default']
const IconCapStopCircle: typeof import('~icons/cap/stop-circle.jsx')['default']
const IconCapTrash: typeof import('~icons/cap/trash.jsx')['default']
const IconCapUndo: typeof import('~icons/cap/undo.jsx')['default']
@@ -46,8 +48,11 @@ declare global {
const IconLucideBell: typeof import('~icons/lucide/bell.jsx')['default']
const IconLucideCamera: typeof import('~icons/lucide/camera.jsx')['default']
const IconLucideCheck: typeof import('~icons/lucide/check.jsx')['default']
+ const IconLucideEdit: typeof import('~icons/lucide/edit.jsx')['default']
const IconLucideEye: typeof import('~icons/lucide/eye.jsx')['default']
+ const IconLucideFolder: typeof import('~icons/lucide/folder.jsx')['default']
const IconLucideLoaderCircle: typeof import('~icons/lucide/loader-circle.jsx')['default']
+ const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']
const IconLucideRabbit: typeof import('~icons/lucide/rabbit.jsx')['default']
const IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw.jsx')['default']
const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']