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

fix #47 #48

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ 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).

## [1.11.1.4]

- fix #47 null error;
- fix occasionally can't open flashcard modal;
- fix lint errors;

## [1.11.1.3]

- merge master branch;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-spaced-repetition-recall",
"name": "Spaced Repetition Recall",
"version": "1.11.1.3",
"version": "1.11.1.4",
"minAppVersion": "0.15.4",
"description": "Fight the forgetting curve by reviewing flashcards & entire notes.",
"author": "Newdea",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-spaced-repetition",
"version": "1.11.1.3",
"version": "1.11.1.4",
"description": "Fight the forgetting curve by reviewing flashcards & entire notes.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/algorithms/balance/reschedule.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { RepetitionItem } from "src/dataStore/repetitionItem";
import { DateUtils, debug } from "src/util/utils_recall";

Check warning on line 2 in src/algorithms/balance/reschedule.ts

View workflow job for this annotation

GitHub Actions / lint_and_test

'DateUtils' is defined but never used. Allowed unused vars must match /^_/u
import { SrsAlgorithm } from "../algorithms";
import { FsrsAlgorithm, FsrsData } from "../fsrs";

export function reschedule(items: RepetitionItem[]): RepetitionItem[] {
let reCnt = 0;
console.group(`reschedule`);
console.group("reschedule");
if (items[0].isFsrs) {
const result = reschedule_fsrs(items);
reCnt = result.reCnt;
Expand Down
3 changes: 1 addition & 2 deletions src/algorithms/supermemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { DateUtils, MiscUtils } from "src/util/utils_recall";
import { SrsAlgorithm, algorithmNames } from "./algorithms";
import deepcopy from "deepcopy";
import { AnkiAlgorithm, AnkiSettings } from "./anki";
import { balance } from "./balance/balance";
import { RepetitionItem, ReviewResult } from "src/dataStore/repetitionItem";

interface Sm2Data {
Expand Down Expand Up @@ -78,7 +77,7 @@ export class Sm2Algorithm extends SrsAlgorithm {
nextReview: nextReview * DateUtils.DAYS_TO_MILLIS,
};
} else {
let nextReview = interval(data.iteration);
const nextReview = interval(data.iteration);
data.iteration += 1;
data.ease = data.ease + (0.1 - (5 - q) * (0.08 + (5 - q) * 0.02));
if (data.ease < 1.3) {
Expand Down
6 changes: 3 additions & 3 deletions src/dataStore/itemToDecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ export class ItemToDecks {
let now_number: number = now;
const nowToday: number = DateUtils.EndofToday;

if (!trackedFile.isDefault && (item == null || !item.isTracked)) {
item.setTracked(ind);
}
if (item == null) {
// store._updateItem(fileid, ind, RPITEMTYPE.NOTE, rdeck.deckName);
// item = store.getItembyID(fileid);
console.debug("syncRCDataToSRrevDeck update null item:", item, trackedFile);
return;
}
if (!trackedFile.isDefault && !item.isTracked) {
item.setTracked(ind);
}
const latterQue = store.data.queues.toDayLatterQueue;
delete latterQue[fileid];
if (now == null) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ export default class SRPlugin extends Plugin {
await this.saveData(this.data);
}

initView(): void {
async initView(): Promise<void> {
this.registerView(
REVIEW_QUEUE_VIEW_TYPE,
(leaf) => (this.reviewQueueView = new ReviewQueueListView(leaf, this)),
Expand All @@ -902,10 +902,11 @@ export default class SRPlugin extends Plugin {
this.data.settings.enableNoteReviewPaneOnStartup &&
this.app.workspace.getLeavesOfType(REVIEW_QUEUE_VIEW_TYPE).length == 0
) {
this.app.workspace.getRightLeaf(false).setViewState({
await this.app.workspace.getRightLeaf(false).setViewState({
type: REVIEW_QUEUE_VIEW_TYPE,
active: true,
});
this.reviewQueueView = this.app.workspace.getActiveViewOfType(ReviewQueueListView);
}
}

Expand Down
Loading