Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaUshio committed Nov 25, 2023
1 parent c87b1ed commit 87d2c30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
6 changes: 3 additions & 3 deletions src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 }))
};
}

Expand All @@ -66,7 +66,7 @@ export class PreambleManager extends Component {
await Promise.all(promises);

this.folderPreambles = new Map<string, string>();
for (const { folderPath, preamblePath } of data.folderPreambes) {
for (const { folderPath, preamblePath } of data.folderPreambles) {
this.folderPreambles.set(normalizePath(folderPath), preamblePath);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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);
});
})
Expand Down

0 comments on commit 87d2c30

Please sign in to comment.