Skip to content

Commit

Permalink
fix: 🐛 I don't think it has to be a breaking change...
Browse files Browse the repository at this point in the history
Check if next/prev are undefined, set a better default, if so
  • Loading branch information
SkepticMystic committed Nov 19, 2021
1 parent 79dd8b1 commit 5524c29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import { openView, wait } from "obsidian-community-lib/dist/utils";
import { BCSettingTab } from "src/BreadcrumbsSettingTab";
import {
blankDirObjs,
blankDirUndef,
DEFAULT_SETTINGS,
DIRECTIONS,
MATRIX_VIEW,
Expand Down Expand Up @@ -117,6 +119,12 @@ export default class BCPlugin extends Plugin {
console.log("loading breadcrumbs plugin");

await this.loadSettings();
["prev", "next"].forEach((dir) => {
this.settings.userHierarchies.forEach(async (hier, i) => {
if (hier[dir] === undefined) this.settings.userHierarchies[i][dir] = [];
await this.saveSettings();
});
});

this.registerView(
STATS_VIEW,
Expand Down

0 comments on commit 5524c29

Please sign in to comment.