Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(auth): persist plan update even when org fetch fails on self-hosted

ManthanNimodiya3adbb967a617
diff --git a/apps/desktop/src-tauri/src/auth.rs b/apps/desktop/src-tauri/src/auth.rs
index 2be30d10c..d1b2ba867 100644
--- a/apps/desktop/src-tauri/src/auth.rs
+++ b/apps/desktop/src-tauri/src/auth.rs
@@ -100,10 +100,15 @@ impl AuthStore {
last_checked: chrono::Utc::now().timestamp() as i32,
manual: auth.plan.as_ref().is_some_and(|p| p.manual),
});
- auth.organizations = api::fetch_organizations(app)
- .await
- .map_err(|e| e.to_string())?;
- auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
+ match api::fetch_organizations(app).await {
+ Ok(orgs) => {
+ auth.organizations = orgs;
+ auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
+ }
+ Err(e) => {
+ println!("Failed to fetch organizations: {e}");
+ }
+ }
Self::set(app, Some(auth))?;