update per event kind

This commit is contained in:
2026-09-27 08:34:13 +07:00
parent 4d2d058396
commit c170c4a800
6 changed files with 75 additions and 63 deletions
+1 -14
View File
@@ -68,24 +68,11 @@ impl RepoListStore {
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
let relevant = match event {
BackendEvent::NostrUpdate(updates) => updates.iter().any(|update| {
// Deletions may target anything we list, always refresh.
if update.kind == Kind::EventDeletion || update.kind == Kind::RequestToVanish {
true
} else if filters::ACTIVITY_KINDS.contains(&update.kind) {
// Activity events are addressed to repos via `a` tags.
// Their author is not the repo owner, always refresh.
true
} else {
let is_announcement = update.kind == Kind::GitRepoAnnouncement;
let is_repo_state = update.kind == Kind::RepoState;
is_announcement || is_repo_state
}
}),
BackendEvent::SignerChanged => {
this.state_synced_repos.clear();
true
}
BackendEvent::RepoUpdates(_) => true,
BackendEvent::Synced => true,
_ => false,
};