mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
fix undoing last learning card corner case
This commit is contained in:
parent
fc931c3edb
commit
746b19e38c
1 changed files with 4 additions and 1 deletions
|
@ -164,7 +164,10 @@ impl CardQueues {
|
|||
.current_learning_cutoff
|
||||
.adding_secs(self.learn_ahead_secs)
|
||||
{
|
||||
self.counts.learning -= 1;
|
||||
// The saturating_sub() deals with a corner case: one remaining
|
||||
// learning card, delayed so it doesn't appear twice. Will be
|
||||
// within the current cutoff but not included in the count.
|
||||
self.counts.learning = self.counts.learning.saturating_sub(1);
|
||||
}
|
||||
Some(entry)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue