Skip to content

Commit

Permalink
Fixed missing button text, new & due cards are now intermingled
Browse files Browse the repository at this point in the history
  • Loading branch information
psaunderualberta committed Jun 17, 2023
1 parent 4c99b20 commit 461271a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/flashcard-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1036,8 +1036,9 @@ export class Deck {

if (modal.ignoreStats) {
// Same for mobile/desktop
modal.impossibleBtn.setText(`${modal.plugin.data.settings.flashcardHardText}`);
modal.impossibleBtn.setText(`${modal.plugin.data.settings.flashcardImpossibleText}`);
modal.hardBtn.setText(`${modal.plugin.data.settings.flashcardHardText}`);
modal.goodBtn.setText(`${modal.plugin.data.settings.flashcardGoodText}`);
modal.easyBtn.setText(`${modal.plugin.data.settings.flashcardEasyText}`);
} else if (Platform.isMobile) {
modal.impossibleBtn.setText(textInterval(impossibleInterval, true));
Expand Down Expand Up @@ -1084,8 +1085,6 @@ export class Deck {
static comparator(a: Card, b: Card): number {
// New cards are reviewed after due cards.
if (!a.isDue && !b.isDue) return 0;
if (a.isDue && !b.isDue) return -1;
if (!a.isDue && b.isDue) return 1;

const now = window.moment(Date.now()).valueOf();

Expand All @@ -1097,7 +1096,7 @@ export class Deck {
return aReviewDelay < bReviewDelay ? -1 : 1;
}

// One redue, other is due
// One redue, other is due or new
if (a.isReDue) {
const aDiff = now - a.previousReview + a.interval * 60 * 1000;
return aDiff > 0 ? 1 : -1;
Expand Down

0 comments on commit 461271a

Please sign in to comment.