diff --git a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js index 0584b96f..a69b98ef 100644 --- a/examples/apps/screenpipe-app-tauri/scripts/pre_build.js +++ b/examples/apps/screenpipe-app-tauri/scripts/pre_build.js @@ -280,9 +280,9 @@ if (hasFeature('rocm')) { // Development hints if (!process.env.GITHUB_ENV) { console.log('\nCommands to build 🔨:') - if (originalCWD != cwd) { - // Get relative path to desktop folder - const relativePath = path.relative(originalCWD, path.join(cwd, '..')) + // Get relative path to screenpipe-app-tauri folder + const relativePath = path.relative(originalCWD, path.join(cwd, '..')) + if (originalCWD != cwd && relativePath != '') { console.log(`cd ${relativePath}`) } console.log('bun install') diff --git a/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs b/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs index 3852daac..366c83fc 100755 --- a/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs +++ b/examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs @@ -4,6 +4,7 @@ use dirs::home_dir; use log::{debug, error, info, LevelFilter}; use logs::MultiWriter; +use tauri::Config; use tauri_plugin_shell::ShellExt; use serde_json::Value; @@ -184,6 +185,26 @@ async fn main() { let stores = app.app_handle().state::>(); + // Initialize the store with default values if it doesn't exist + let _ = with_store( + app.app_handle().clone(), + stores.clone(), + path.clone(), + |store| { + if store.keys().count() == 0 { + // Set default values + store.insert("analytics_enabled".to_string(), Value::Bool(true))?; + store.insert( + "config".to_string(), + serde_json::to_value(Config::default())?, + )?; + store.save()?; + } + Ok(()) + }, + ); + + // Now use the store let _ = with_store(app.app_handle().clone(), stores, path, |store| { store.save()?;