diff --git a/screenpipe-app-tauri/src-tauri/src/main.rs b/screenpipe-app-tauri/src-tauri/src/main.rs index 38f5bd4d7..0419b61f2 100755 --- a/screenpipe-app-tauri/src-tauri/src/main.rs +++ b/screenpipe-app-tauri/src-tauri/src/main.rs @@ -20,7 +20,6 @@ use tauri::{ }; use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_autostart::ManagerExt; -use tauri_plugin_deep_link::DeepLinkExt; #[allow(unused_imports)] use tauri_plugin_shell::process::CommandEvent; use tauri_plugin_store::StoreBuilder; @@ -440,19 +439,29 @@ async fn main() { let sidecar_manager_clone = sidecar_manager.clone(); app.manage(sidecar_manager.clone()); - let sidecar_app_handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - let mut manager = sidecar_manager_clone.lock().await; - if let Err(e) = manager.spawn(&sidecar_app_handle).await { - error!("Failed to spawn initial sidecar: {}", e); - } + let app_handle = app.handle().clone(); - // Spawn a background task to check and restart periodically - let mut manager = sidecar_manager_clone.lock().await; - if let Err(e) = manager.check_and_restart(&sidecar_app_handle).await { - error!("Failed to restart sidecar: {}", e); - } - }); + info!( + "will start sidecar: {}", + !use_dev_mode && !is_first_time_user + ); + + if !use_dev_mode && !is_first_time_user { + tauri::async_runtime::spawn(async move { + let mut manager = sidecar_manager_clone.lock().await; + if let Err(e) = manager.spawn(&app_handle).await { + error!("Failed to spawn initial sidecar: {}", e); + } + + // Spawn a background task to check and restart periodically + let mut manager = sidecar_manager_clone.lock().await; + if let Err(e) = manager.check_and_restart(&app_handle).await { + error!("Failed to restart sidecar: {}", e); + } + }); + } else { + debug!("Dev mode enabled, skipping sidecar spawn and restart"); + } // Inside the main function, after the `app.manage(port);` line, add: let server_shutdown_tx = spawn_server(app.handle().clone(), 11435);