From 5524c2981ee10d925f7b8f5630aa6e7195b2df2f Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Fri, 19 Nov 2021 08:54:07 +0200 Subject: [PATCH] fix: :bug: I don't think it has to be a breaking change... Check if next/prev are undefined, set a better default, if so --- src/main.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.ts b/src/main.ts index 8873d35f..561165d0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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, @@ -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,