feat: add syncing progress

This commit is contained in:
2026-10-26 09:54:38 +07:00
parent 0824b1825b
commit 4d0e2f5050
6 changed files with 193 additions and 77 deletions
+8 -1
View File
@@ -232,6 +232,7 @@ impl WebOfTrust {
.idle_timeout(Duration::from_secs(SYNC_IDLE_TIMEOUT));
self.syncing = true;
cx.notify();
self.refresh_task = Some(cx.spawn(async move |this, cx| {
// Scope the reconcile to the follow set known so far
@@ -265,12 +266,13 @@ impl WebOfTrust {
this.snapshot = Some(snapshot);
cx.emit(WoTEvent);
cx.notify();
if grew {
this.sync(cx);
}
}
cx.notify();
})
.ok();
}));
@@ -314,6 +316,11 @@ impl WebOfTrust {
.is_some_and(|snapshot| !snapshot.disabled)
}
/// Whether a reconciliation with the relays is in flight
pub fn is_syncing(&self) -> bool {
self.syncing
}
/// Whether the snapshot covers a follow set
fn has_data(&self) -> bool {
self.snapshot