forked from janek/mostr
fix(tasks): properly find current position when futures are involved
This commit is contained in:
parent
e0d241ec5a
commit
629db66018
|
@ -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()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue