This commit is contained in:
2026-08-06 14:52:43 +07:00
parent 6d5d154486
commit 0c6d700395
4 changed files with 23 additions and 27 deletions
+5 -4
View File
@@ -21,15 +21,16 @@ impl RepoListStore {
/// Create a store. If `author` is `None`, all announcements are listed.
pub fn new(author: Option<PublicKey>, cx: &mut Context<Self>) -> Self {
let backend = Backend::global(cx);
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
let git_kind = Kind::GitRepoAnnouncement;
let relevant = match event {
BackendEvent::NostrUpdate(update) => {
update.kind == Kind::GitRepoAnnouncement
&& this.author.is_none_or(|a| a == update.author)
update.kind == git_kind && this.author.is_none_or(|a| a == update.author)
}
BackendEvent::Published(event) => {
event.kind == Kind::GitRepoAnnouncement
&& this.author.is_none_or(|a| a == event.pubkey)
event.kind == git_kind && this.author.is_none_or(|a| a == event.pubkey)
}
BackendEvent::Synced | BackendEvent::SyncProgress { .. } => true,
_ => false,