feat: immersive onboarding (#189)

* feat: change the default onboarding column

* feat: add newsfeed onboarding

* feat: add topic onboarding

* feat: add group onboarding

* chore: polish and format

* feat: rename foryou to topic

* fix: array
This commit is contained in:
雨宮蓮
2024-05-22 10:44:19 +07:00
committed by GitHub
parent 9b5867f80c
commit 1f38eba2cc
35 changed files with 2291 additions and 2358 deletions

View File

@@ -97,6 +97,7 @@ pub async fn get_events_by(
#[tauri::command]
pub async fn get_local_events(
pubkeys: Vec<String>,
limit: usize,
until: Option<&str>,
state: State<'_, Nostr>,
@@ -106,26 +107,21 @@ pub async fn get_local_events(
Some(until) => Timestamp::from_str(until).unwrap(),
None => Timestamp::now(),
};
let authors: Vec<PublicKey> = pubkeys
.into_iter()
.map(|p| PublicKey::from_hex(p).unwrap())
.collect();
let filter = Filter::new()
.kinds(vec![Kind::TextNote, Kind::Repost])
.limit(limit)
.authors(authors)
.until(as_of);
match client
.get_contact_list_public_keys(Some(Duration::from_secs(10)))
.get_events_of(vec![filter], Some(Duration::from_secs(8)))
.await
{
Ok(contacts) => {
let filter = Filter::new()
.kinds(vec![Kind::TextNote, Kind::Repost])
.limit(limit)
.authors(contacts)
.until(as_of);
match client
.get_events_of(vec![filter], Some(Duration::from_secs(8)))
.await
{
Ok(events) => Ok(events),
Err(err) => Err(err.to_string()),
}
}
Ok(events) => Ok(events),
Err(err) => Err(err.to_string()),
}
}