Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make reset button (flashcard review modal) enabled for both new and due cards #650

Merged
merged 8 commits into from
Mar 10, 2024
2 changes: 1 addition & 1 deletion CHANGELOG.md
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### Unreleased

- Make reset button (flashcard review modal) enabled for both new and due cards https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/650

#### [1.11.2](https://github.com/st3v3nmw/obsidian-spaced-repetition/compare/1.11.1...1.11.2)

- Bug 495 Obsidian SRS ignores more than one tag https://github.com/st3v3nmw/obsidian-spaced-repetition/pull/834
Expand Down
14 changes: 10 additions & 4 deletions src/FlashcardReviewSequencer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,16 @@ export class FlashcardReviewSequencer implements IFlashcardReviewSequencer {
}

async processReview_ReviewMode(response: ReviewResponse): Promise<void> {
this.currentCard.scheduleInfo = this.determineCardSchedule(response, this.currentCard);

// Update the source file with the updated schedule
await this.currentQuestion.writeQuestion(this.settings);
if (response != ReviewResponse.Reset || this.currentCard.hasSchedule) {
// We need to update the schedule if:
// (1) the user reviewed with easy/good/hard (either a new or due card),
// (2) or reset a due card
// Nothing to do if a user resets a new card
this.currentCard.scheduleInfo = this.determineCardSchedule(response, this.currentCard);

// Update the source file with the updated schedule
await this.currentQuestion.writeQuestion(this.settings);
}

// Move/delete the card
if (response == ReviewResponse.Reset) {
Expand Down
4 changes: 1 addition & 3 deletions src/gui/flashcard-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ export class FlashcardModal extends Modal {
this.answerBtn.style.display = "none";
this.responseDiv.style.display = "grid";

if (this.currentCard.hasSchedule) {
this.resetButton.disabled = false;
}
this.resetButton.disabled = false;

if (this.currentQuestion.questionType !== CardType.Cloze) {
const hr: HTMLElement = document.createElement("hr");
Expand Down
Loading