mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
Fix/seconds elapsed since last review in card stats shouldn't be negative
This commit is contained in:
parent
5cb191d624
commit
e7d1bba825
1 changed files with 3 additions and 3 deletions
|
|
@ -29,12 +29,12 @@ impl Collection {
|
|||
let revlog = self.storage.get_revlog_entries_for_card(card.id)?;
|
||||
|
||||
let (average_secs, total_secs) = average_and_total_secs_strings(&revlog);
|
||||
let timing = self.timing_today()?;
|
||||
let seconds_elapsed = self
|
||||
.storage
|
||||
.time_of_last_review(card.id)?
|
||||
.map(|ts| timing.now.elapsed_secs_since(ts))
|
||||
.unwrap_or_default() as u32;
|
||||
.map(|ts| TimestampSecs::now().elapsed_secs_since(ts))
|
||||
.unwrap_or_default()
|
||||
.max(0) as u32;
|
||||
let fsrs_retrievability = card
|
||||
.memory_state
|
||||
.zip(Some(seconds_elapsed))
|
||||
|
|
|
|||
Loading…
Reference in a new issue