Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(auth): only stamp org timestamp on failure when orgs list is empty

ManthanNimodiyaec233e7387d4
diff --git a/apps/desktop/src-tauri/src/auth.rs b/apps/desktop/src-tauri/src/auth.rs
index 3f640757a..5ae16506d 100644
--- a/apps/desktop/src-tauri/src/auth.rs
+++ b/apps/desktop/src-tauri/src/auth.rs
@@ -98,10 +98,15 @@ impl AuthStore {
match api::fetch_organizations(app).await {
Ok(orgs) => {
auth.organizations = orgs;
+ auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
+ }
+ Err(e) => {
+ tracing::warn!("Failed to fetch organizations: {e}");
+ if auth.organizations.is_empty() {
+ auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
+ }
}
- Err(e) => tracing::warn!("Failed to fetch organizations: {e}"),
}
- auth.organizations_updated_at = Some(chrono::Utc::now().timestamp() as i32);
Self::set(app, Some(auth))?;