fix(task): adjust to inverted ordering of sdk 0.36

https://github.com/rust-nostr/nostr/issues/632
This commit is contained in:
xeruf 2024-11-14 19:05:58 +01:00
parent 43f8a3ebca
commit 473f26d7a5
1 changed files with 2 additions and 2 deletions

View File

@ -115,7 +115,7 @@ impl Task {
}
pub(crate) fn priority_raw(&self) -> Option<&str> {
self.props.iter().rev()
self.props.iter()
.chain(once(&self.event))
.find_map(|p| {
p.tags.iter().find_map(|t|
@ -140,7 +140,7 @@ impl Task {
pub(crate) fn state(&self) -> Option<TaskState> {
let now = now();
// TODO do not iterate constructed state objects
let state = self.states().rev().take_while_inclusive(|ts| ts.time > now);
let state = self.states().take_while_inclusive(|ts| ts.time > now);
state.last().map(|ts| {
if ts.time <= now {
ts