diff --git a/src/algorithms/balance/reschedule.ts b/src/algorithms/balance/reschedule.ts index 0d432ebb..7bb56f13 100644 --- a/src/algorithms/balance/reschedule.ts +++ b/src/algorithms/balance/reschedule.ts @@ -5,7 +5,7 @@ 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; diff --git a/src/algorithms/supermemo.ts b/src/algorithms/supermemo.ts index 1ba2f4dd..e640b3f5 100644 --- a/src/algorithms/supermemo.ts +++ b/src/algorithms/supermemo.ts @@ -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 { @@ -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) { diff --git a/src/dataStore/itemToDecks.ts b/src/dataStore/itemToDecks.ts index 92818c5d..ed8dbcbf 100644 --- a/src/dataStore/itemToDecks.ts +++ b/src/dataStore/itemToDecks.ts @@ -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) { diff --git a/src/main.ts b/src/main.ts index f726e576..304bf5b2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -892,7 +892,7 @@ export default class SRPlugin extends Plugin { await this.saveData(this.data); } - initView(): void { + async initView(): Promise { this.registerView( REVIEW_QUEUE_VIEW_TYPE, (leaf) => (this.reviewQueueView = new ReviewQueueListView(leaf, this)), @@ -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); } }