fix(task): adjust to inverted ordering of sdk 0.36
https://github.com/rust-nostr/nostr/issues/632
This commit is contained in:
parent
43f8a3ebca
commit
473f26d7a5
|
@ -115,7 +115,7 @@ impl Task {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn priority_raw(&self) -> Option<&str> {
|
pub(crate) fn priority_raw(&self) -> Option<&str> {
|
||||||
self.props.iter().rev()
|
self.props.iter()
|
||||||
.chain(once(&self.event))
|
.chain(once(&self.event))
|
||||||
.find_map(|p| {
|
.find_map(|p| {
|
||||||
p.tags.iter().find_map(|t|
|
p.tags.iter().find_map(|t|
|
||||||
|
@ -140,7 +140,7 @@ impl Task {
|
||||||
pub(crate) fn state(&self) -> Option<TaskState> {
|
pub(crate) fn state(&self) -> Option<TaskState> {
|
||||||
let now = now();
|
let now = now();
|
||||||
// TODO do not iterate constructed state objects
|
// 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| {
|
state.last().map(|ts| {
|
||||||
if ts.time <= now {
|
if ts.time <= now {
|
||||||
ts
|
ts
|
||||||
|
|
Loading…
Reference in New Issue