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 get_position(&self) -> Option<EventId> {
self.history.get(&self.sender.pubkey())
.and_then(|tree| tree.last())
self.history_until(Timestamp::from(Timestamp::now() + Self::MAX_OFFSET))
.last()
.and_then(|e| referenced_events(e))
.cloned()
}