update repo list

This commit is contained in:
2026-08-05 09:24:46 +07:00
parent f497279886
commit fdf74327bb
4 changed files with 102 additions and 56 deletions
+4 -2
View File
@@ -20,7 +20,8 @@ pub struct RepoListStore {
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 subscription = cx.subscribe(&Backend::global(cx), |this, _backend, event, cx| {
let backend = Backend::global(cx);
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
let relevant = match event {
BackendEvent::NostrUpdate(update) => {
update.kind == Kind::GitRepoAnnouncement
@@ -60,9 +61,10 @@ impl RepoListStore {
}
fn subscribe_remote(&mut self, cx: &mut Context<Self>) {
let backend = Backend::global(cx);
let author = self.author;
Backend::global(cx).update(cx, |backend, cx| {
backend.update(cx, |backend, cx| {
let filter = match author {
Some(a) => filters::announcements_by(a),
None => filters::all_announcements(500),