Skip to content

Commit

Permalink
fix the setting issue, add missed field
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hub committed Dec 16, 2022
1 parent 8dd061b commit 7abe319
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/VerseSuggesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export class VerseSuggesting implements IVerseSuggesting {
public get ReplacementContent(): string {
let head = `> [!Bible]`;
let bottom = '';
if (this.settings.collapsibleVerses==true){
if (this.settings?.collapsibleVerses){
head += '-';
}
}
head += ' ';

if (this.settings.referenceLinkPosition === BibleVerseReferenceLinkPosition.Header || this.settings.referenceLinkPosition === BibleVerseReferenceLinkPosition.AllAbove ) {
Expand Down
2 changes: 2 additions & 0 deletions src/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ export const APP_NAMING = {
export interface BibleReferencePluginSettings {
bibleVersion: string;
referenceLinkPosition?: BibleVerseReferenceLinkPosition;
collapsibleVerses?: boolean;
}

export const DEFAULT_SETTINGS: BibleReferencePluginSettings = {
bibleVersion: BibleVersionCollection[0].key,
referenceLinkPosition: BibleVerseReferenceLinkPosition.Header,
collapsibleVerses: false,
}
2 changes: 1 addition & 1 deletion src/ui/BibleReferenceSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class BibleReferenceSettingTab extends PluginSettingTab {
new Setting(containerEl)
.setName('Make Verses Collapsible')
.setDesc('Make the inserted verses collapsible')
.addToggle(toggle => toggle.setValue(this.plugin.settings.collapsibleVerses)
.addToggle(toggle => toggle.setValue(!!this.plugin.settings?.collapsibleVerses)
.onChange((value) => {
this.plugin.settings.collapsibleVerses = value;
this.plugin.saveData(this.plugin.settings);
Expand Down

0 comments on commit 7abe319

Please sign in to comment.