fix a panic when browser encounters a filtered card outside filtered deck

the -99999 due date overflows the i32, yielding to a stuck interface
when running in a debug build
This commit is contained in:
Damien Elmes 2021-05-25 13:44:42 +10:00
parent f91f00a542
commit 52676f1555

View file

@ -104,10 +104,9 @@ impl Card {
if self.queue == CardQueue::Learn { if self.queue == CardQueue::Learn {
Some(TimestampSecs(self.due as i64)) Some(TimestampSecs(self.due as i64))
} else if self.is_due_in_days() { } else if self.is_due_in_days() {
Some( Some(TimestampSecs::now().adding_secs(
TimestampSecs::now() ((self.due - timing.days_elapsed as i32).saturating_mul(86400)) as i64,
.adding_secs(((self.due - timing.days_elapsed as i32) * 86400) as i64), ))
)
} else { } else {
None None
} }