Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
fix #47 ;
fix view error
  • Loading branch information
Newdea committed Feb 19, 2024
1 parent e8bf3f3 commit 5ab2b85
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/algorithms/balance/reschedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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

0 comments on commit 5ab2b85

Please sign in to comment.