update repo list
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user