Skip to content

Commit

Permalink
fix(note stats): destroy grid after closing settings (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nmw authored Oct 21, 2024
1 parent e674e1b commit e201b84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Fight the forgetting curve by reviewing flashcards & notes using spaced repetiti
- [Single-line reversed style](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/q-and-a-cards/#single-line-bidirectional) (`Question:::Answer`)
- [Multi-line style](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/q-and-a-cards/#multi-line-basic) (Separated by `?`)
- [Multi-line reversed style](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/q-and-a-cards/#multi-line-bidirectional) (Separated by `??`)
- [Cloze cards](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/cloze-cards/) (`==highlight==` your cloze deletions!, `**bolded text**`, `{{text in curly braces}}`, or custom cloze patterns)
- [Cloze cards](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/cloze-cards/) (`==highlight==` your cloze deletions!, `**bolded text**`, `{{text in curly braces}}`, or use custom cloze patterns)
- [Card context - automatic titles based on headings](https://www.stephenmwangi.com/obsidian-spaced-repetition/flashcards/reviewing/#context) (i.e. `Note title > Heading 1 > Subheading`)
- Rich text support in flashcards (inherited from Obsidian)
- Images, Audio, & Video
Expand Down
6 changes: 4 additions & 2 deletions src/gui/statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class StatisticsView {
private intervalsChart: Chart;
private easesChart: Chart;
private cardTypesChart: Chart;
private noteStatsGrid: Grid;

constructor(containerEl: HTMLElement, osrCore: OsrCore) {
this.containerEl = containerEl;
Expand Down Expand Up @@ -201,7 +202,7 @@ export class StatisticsView {
],
);

const grid = new Grid({
this.noteStatsGrid = new Grid({
columns: [
{
name: t("NOTE"),
Expand Down Expand Up @@ -229,14 +230,15 @@ export class StatisticsView {
},
},
});
grid.render(document.getElementById("noteStats"));
this.noteStatsGrid.render(document.getElementById("noteStats"));
}

destroy(): void {
this.forecastChart.destroy();
this.intervalsChart.destroy();
this.easesChart.destroy();
this.cardTypesChart.destroy();
this.noteStatsGrid.destroy();
}
}

Expand Down

0 comments on commit e201b84

Please sign in to comment.