Skip to content

Commit

Permalink
fix: Only consider filtered notes for next note
Browse files Browse the repository at this point in the history
The previous patch #1088 missed to change the conditional to also
include only the filtered notes. With this patch, if all scheduled notes
are in the future, it will choose a new note for review.
  • Loading branch information
carlosgaldino committed Sep 24, 2024
1 parent e92eabc commit 3025a4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/note-review-deck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export class NoteReviewDeck {

determineNextNote(openRandomNote: boolean): ISRFile {
// Review due notes before new ones
if (this.dueNotesCount > 0) {
const todayUnix: number = globalDateProvider.today.valueOf();
const dueNotes = this.scheduledNotes.filter((note) => note.isDue(todayUnix));
const todayUnix: number = globalDateProvider.today.valueOf();
const dueNotes = this.scheduledNotes.filter((note) => note.isDue(todayUnix));
if (dueNotes.length > 0) {
const index = openRandomNote
? globalRandomNumberProvider.getInteger(0, dueNotes.length - 1)
: 0;
Expand Down

0 comments on commit 3025a4d

Please sign in to comment.