Skip to content

Commit 57cac7e

Browse files
committed
add plugin name to notice on initial load for misspelling list
1 parent 10ed92d commit 57cac7e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default class LinterPlugin extends Plugin {
135135

136136
async saveSettings() {
137137
if (!this.hasLoadedMisspellingFiles) {
138-
await this.loadAutoCorrectFiles();
138+
await this.loadAutoCorrectFiles(false);
139139
}
140140

141141
await this.saveData(this.settings);
@@ -273,7 +273,7 @@ export default class LinterPlugin extends Plugin {
273273

274274
this.app.workspace.onLayoutReady(async () => {
275275
await this.makeSureSettingsFilledInAndCleanupSettings();
276-
await this.loadAutoCorrectFiles();
276+
await this.loadAutoCorrectFiles(true);
277277
});
278278

279279
// Source for save setting
@@ -320,13 +320,17 @@ export default class LinterPlugin extends Plugin {
320320
}
321321
}
322322

323-
async loadAutoCorrectFiles() {
323+
async loadAutoCorrectFiles(isOnload: boolean) {
324324
const customAutoCorrectSettings = this.settings.ruleConfigs['auto-correct-common-misspellings'];
325325
if (!customAutoCorrectSettings || !customAutoCorrectSettings.enabled) {
326326
return;
327327
}
328328

329329
await downloadMisspellings(this, async (message: string) => {
330+
if (isOnload) {
331+
message = 'Obsidian Linter:\n' + message;
332+
}
333+
330334
new Notice(message);
331335

332336
this.settings.ruleConfigs['auto-correct-common-misspellings'].enabled = false;

0 commit comments

Comments
 (0)