Skip to content

Commit 3af9191

Browse files
authored
Merge pull request #198 from prefrontalsys/fix/disconnect-clears-state
Fix: filter empty strings in sync auth status after disconnect
2 parents 14c9600 + 815cf4c commit 3af9191

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src-tauri/src/commands/cloud_sync.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ pub async fn connect_cloud_sync(
109109
#[tauri::command]
110110
pub fn get_sync_auth_status(db: State<'_, Arc<Mutex<Database>>>) -> Result<SyncAuthStatus, String> {
111111
let db = db.lock().map_err(|e| e.to_string())?;
112-
let token = db.get_setting("github_token");
113-
let username = db.get_setting("sync_username");
114-
let gist_id = db.get_setting("sync_gist_id");
115-
let gist_url = db.get_setting("sync_gist_url");
112+
let token = db.get_setting("github_token").filter(|s| !s.is_empty());
113+
let username = db.get_setting("sync_username").filter(|s| !s.is_empty());
114+
let gist_id = db.get_setting("sync_gist_id").filter(|s| !s.is_empty());
115+
let gist_url = db.get_setting("sync_gist_url").filter(|s| !s.is_empty());
116116
let has_gh = has_gh_cli();
117117

118118
Ok(SyncAuthStatus {

0 commit comments

Comments
 (0)