feat: add basic profile panel
This commit is contained in:
@@ -60,6 +60,16 @@ impl Profile {
|
||||
.map(|p| SharedString::from(p.clone()))
|
||||
}
|
||||
|
||||
/// The user's bio, when set and non-empty.
|
||||
pub fn about(&self) -> Option<SharedString> {
|
||||
self.metadata
|
||||
.about
|
||||
.as_ref()
|
||||
.map(|about| about.trim().to_owned())
|
||||
.filter(|about| !about.is_empty())
|
||||
.map(SharedString::from)
|
||||
}
|
||||
|
||||
/// The newest profile per author from metadata events.
|
||||
fn latest_profiles(events: impl IntoIterator<Item = Event>) -> Vec<Self> {
|
||||
let mut latest: HashMap<PublicKey, (Timestamp, Metadata)> = HashMap::new();
|
||||
@@ -138,7 +148,6 @@ impl ProfileStore {
|
||||
|
||||
loop {
|
||||
let now = Instant::now();
|
||||
|
||||
if now >= deadline {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user