From 87d2c309e88f0dd0c21c47ab0d49596a6ce76f7a Mon Sep 17 00:00:00 2001 From: RyotaUshio Date: Sun, 26 Nov 2023 00:45:15 +0900 Subject: [PATCH] Fix typo --- src/main.ts | 2 +- src/manager.ts | 6 +++--- src/settings/settings.ts | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index 5692023..2de55ad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -12,7 +12,7 @@ export default class MathJaxPreamblePlugin extends Plugin { await loadMathJax(); const data = await this.loadData() ?? {} as { preambles?: SerializedPreambles }; - const serializedPreambles = data['preambles'] || { preambles: [], folderPreambes: [] }; + const serializedPreambles = data['preambles'] || { preambles: [], folderPreambles: [] }; this.addSettingTab(new MathJaxPreamblePluginSettingTab(this)); diff --git a/src/manager.ts b/src/manager.ts index f060cb9..b5397c1 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -8,7 +8,7 @@ export interface Preamble { export interface SerializedPreambles { preambles: { path: string }[]; - folderPreambes: { folderPath: string, preamblePath: string }[]; + folderPreambles: { folderPath: string, preamblePath: string }[]; } export class PreambleManager extends Component { @@ -41,7 +41,7 @@ export class PreambleManager extends Component { serialize(): SerializedPreambles { return { preambles: [...this.preambles.values()].map(({ path }) => ({ path })), - folderPreambes: [...this.folderPreambles.entries()].map(([folderPath, preamblePath]) => ({ folderPath, preamblePath })) + folderPreambles: [...this.folderPreambles.entries()].map(([folderPath, preamblePath]) => ({ folderPath, preamblePath })) }; } @@ -66,7 +66,7 @@ export class PreambleManager extends Component { await Promise.all(promises); this.folderPreambles = new Map(); - for (const { folderPath, preamblePath } of data.folderPreambes) { + for (const { folderPath, preamblePath } of data.folderPreambles) { this.folderPreambles.set(normalizePath(folderPath), preamblePath); } } diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 3f2bbea..9357ba1 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -63,13 +63,13 @@ export class MathJaxPreamblePluginSettingTab extends PluginSettingTab { button.setButtonText('Add') .setCta() .onClick(() => { - serialized.folderPreambes.push({ folderPath: "", preamblePath: "" }); + serialized.folderPreambles.push({ folderPath: "", preamblePath: "" }); this._display(serialized); }); }); i = 1; - for (const folderPreamble of serialized.folderPreambes) { + for (const folderPreamble of serialized.folderPreambles) { new Setting(containerEl) .setName(`Folder preamble ${i}`) .addText((text) => { @@ -96,8 +96,8 @@ export class MathJaxPreamblePluginSettingTab extends PluginSettingTab { .addExtraButton((button) => { button.setIcon('trash') .onClick(() => { - const index = serialized.folderPreambes.findIndex(({ folderPath }) => folderPath === folderPreamble.folderPath); - serialized.folderPreambes.splice(index, 1); + const index = serialized.folderPreambles.findIndex(({ folderPath }) => folderPath === folderPreamble.folderPath); + serialized.folderPreambles.splice(index, 1); this._display(serialized); }); })