feat: use author name consistently

This commit is contained in:
xeruf 2024-08-19 21:41:45 +03:00
parent f8a4777f71
commit f4cff3d702
2 changed files with 5 additions and 4 deletions

View File

@ -379,11 +379,12 @@ async fn main() {
}
Some('@') => {
let author = arg.and_then(|a| PublicKey::from_str(a).ok()).unwrap_or_else(|| keys.public_key());
let key = arg.and_then(|a| PublicKey::from_str(a).ok()).unwrap_or_else(|| keys.public_key());
let author = tasks.get_author(&key);
info!("Filtering for events by {author}");
tasks.set_filter(
tasks.filtered_tasks(tasks.get_position_ref())
.filter(|t| t.event.pubkey == author)
.filter(|t| t.event.pubkey == key)
.map(|t| t.event.id)
.collect()
)

View File

@ -214,11 +214,11 @@ impl Tasks {
} else {
format_stamp(end, "%H:%M")
},
key))
self.get_author(key)))
}
iter.into_buffer()
.for_each(|(stamp, _)|
vec.push(format!("{} started by {}", local_datetimestamp(stamp), key)));
vec.push(format!("{} started by {}", local_datetimestamp(stamp), self.get_author(key))));
vec
}).sorted_unstable(); // TODO sorting depends on timestamp format - needed to interleave different people
(format!("Times Tracked on {:?}", self.get_task_title(&id)), Box::from(history))