sync all repos

This commit is contained in:
2026-08-05 10:20:12 +07:00
parent 2ec7d14c33
commit ed93d81a26
5 changed files with 78 additions and 14 deletions
+8 -1
View File
@@ -18,10 +18,15 @@ impl Workspace {
let repo_list = cx.new(|cx| RepoListView::new(window, cx));
let connected = backend.read(cx).is_connected();
let sync_progress = backend.read(cx).sync_progress();
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
match event {
BackendEvent::Connected => this.status = "Connected".into(),
BackendEvent::SyncProgress { total, current } => {
this.status = format!("Syncing repositories... {current}/{total}").into()
}
BackendEvent::Synced => this.status = "Connected".into(),
BackendEvent::Error(error) => this.status = error.clone().into(),
_ => return,
}
@@ -30,7 +35,9 @@ impl Workspace {
Self {
active_screen: repo_list.into(),
status: if connected {
status: if let Some((total, current)) = sync_progress {
format!("Syncing repositories... {current}/{total}").into()
} else if connected {
"Connected".into()
} else {
"Connecting...".into()