mirror of
https://github.com/sgranade/manuscriptum.git
synced 2026-07-22 06:43:11 +00:00
feat: Have users fill out blank settings.
This commit is contained in:
parent
777e808cb2
commit
cf8adbd66b
1 changed files with 19 additions and 0 deletions
19
src/main.ts
19
src/main.ts
|
|
@ -168,6 +168,25 @@ export default class ManuscriptumPlugin extends Plugin {
|
|||
contact: this.settings.authorContactInformation.trim(),
|
||||
};
|
||||
|
||||
// Have the user fill out required settings if blank
|
||||
const missingSettings: string[] = [];
|
||||
if (!anonymize) {
|
||||
if (metadata.author === "") missingSettings.push("Author Name");
|
||||
if (metadata.surname === "") missingSettings.push("Author Surname");
|
||||
if (metadata.contact === "")
|
||||
missingSettings.push("Author Contact Information");
|
||||
}
|
||||
if (missingSettings.length > 0) {
|
||||
new Notice(
|
||||
`Please configure Manuscriptum settings: ${missingSettings.join(", ")}.`
|
||||
);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const setting = (this.app as any).setting;
|
||||
await setting.open();
|
||||
setting.openTabById("tab-name");
|
||||
return;
|
||||
}
|
||||
|
||||
const notes = folder.children.filter(
|
||||
(f) => f instanceof TFile && f.extension === "md"
|
||||
) as TFile[];
|
||||
|
|
|
|||
Loading…
Reference in a new issue