mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
handle preview cards in graphs
This commit is contained in:
parent
a1866e72fd
commit
f9891da076
2 changed files with 5 additions and 2 deletions
|
@ -46,6 +46,7 @@ export function gatherData(data: pb.BackendProto.GraphsOut, i18n: I18n): GraphDa
|
|||
// young falls through
|
||||
case CardQueue.Learn:
|
||||
case CardQueue.DayLearn:
|
||||
case CardQueue.PreviewRepeat:
|
||||
young += 1;
|
||||
break;
|
||||
case CardQueue.Suspended:
|
||||
|
|
|
@ -21,16 +21,18 @@ export interface GraphData {
|
|||
}
|
||||
|
||||
export function gatherData(data: pb.BackendProto.GraphsOut): GraphData {
|
||||
const isLearning = (queue: number): boolean =>
|
||||
[CardQueue.Learn, CardQueue.PreviewRepeat].includes(queue);
|
||||
const due = (data.cards as pb.BackendProto.Card[])
|
||||
.filter(
|
||||
(c) =>
|
||||
// reviews
|
||||
[CardQueue.Review, CardQueue.DayLearn].includes(c.queue) ||
|
||||
// or learning cards due today
|
||||
(c.queue == CardQueue.Learn && c.due < data.nextDayAtSecs)
|
||||
(isLearning(c.queue) && c.due < data.nextDayAtSecs)
|
||||
)
|
||||
.map((c) => {
|
||||
if (c.queue == CardQueue.Learn) {
|
||||
if (isLearning(c.queue)) {
|
||||
return 0;
|
||||
} else {
|
||||
// - testing just odue fails on day 1
|
||||
|
|
Loading…
Reference in a new issue