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

Bug 826 auto review next note doesn't work when first note reviewed is not selected from sidebar #827

Merged
merged 8 commits into from
Jan 15, 2024
6 changes: 1 addition & 5 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [Unreleased]

- Feat: Support richer set of flashcard ordering during review; e.g. random card from random deck [`#814`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/814)
- Bug fix Problem with nested list item's indentation [`#800`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/800)
- Bug fix Problem with nested list item's indentation [`#812`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/812)
- Bug Cloze Breaks When }} Encountered [`#799`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/799)
- Bug fix: When reviewing an entire note, the metadata is applied incorrectly (on top of the already existing metadata) [`#776`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/776)
- Bug fix: Auto review next note doesn't work when first note reviewed is not selected from sidebar [`#826`](https://github.com/st3v3nmw/obsidian-spaced-repetition/issues/826)

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

Expand Down
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,21 @@ export default class SRPlugin extends Plugin {

await this.sync();
if (this.data.settings.autoNextNote) {
if (!this.lastSelectedReviewDeck) {
const reviewDeckKeys: string[] = Object.keys(this.reviewDecks);
if (reviewDeckKeys.length > 0) this.lastSelectedReviewDeck = reviewDeckKeys[0];
else {
new Notice(t("ALL_CAUGHT_UP"));
return;
}
}
this.reviewNextNote(this.lastSelectedReviewDeck);
}
}

async reviewNextNoteModal(): Promise<void> {
const reviewDeckNames: string[] = Object.keys(this.reviewDecks);

if (reviewDeckNames.length === 1) {
this.reviewNextNote(reviewDeckNames[0]);
} else {
Expand Down
Loading