forked from janek/mostr
1
0
Fork 0

fix(tasks): properly find current position when futures are involved

This commit is contained in:
xeruf 2024-08-19 13:59:37 +03:00
parent e0d241ec5a
commit 629db66018
1 changed files with 2 additions and 2 deletions

View File

@ -151,8 +151,8 @@ impl Tasks {
pub(crate) fn len(&self) -> usize { self.tasks.len() } pub(crate) fn len(&self) -> usize { self.tasks.len() }
pub(crate) fn get_position(&self) -> Option<EventId> { pub(crate) fn get_position(&self) -> Option<EventId> {
self.history.get(&self.sender.pubkey()) self.history_until(Timestamp::from(Timestamp::now() + Self::MAX_OFFSET))
.and_then(|tree| tree.last()) .last()
.and_then(|e| referenced_events(e)) .and_then(|e| referenced_events(e))
.cloned() .cloned()
} }