From 5f5e3451285b835dd8db8c1651959c20a23ca44a Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Fri, 21 Jan 2022 19:12:13 +0200 Subject: [PATCH] fix(Path View): :bug: Remember to getOppFallback when limiting trail sub --- main.js | 2 +- src/Views/TrailView.ts | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/main.js b/main.js index 03b94db7..87d45d09 100644 --- a/main.js +++ b/main.js @@ -25095,7 +25095,7 @@ function getLimitedTrailSub(plugin) { } else { const oppFields = limitTrailCheckboxes - .map((field) => getOppFields(userHiers, field)[0]) + .map((field) => { var _a, _b; return (_b = (_a = getOppFields(userHiers, field)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : fallbackOppField(field, "up"); }) .filter((field) => field !== undefined); subGraph = getSubForFields(mainG, [...limitTrailCheckboxes, ...oppFields]); } diff --git a/src/Views/TrailView.ts b/src/Views/TrailView.ts index e6c8256f..36264032 100644 --- a/src/Views/TrailView.ts +++ b/src/Views/TrailView.ts @@ -33,7 +33,10 @@ function getLimitedTrailSub(plugin: BCPlugin) { subGraph = getSubInDirs(mainG, "up", "down"); } else { const oppFields = limitTrailCheckboxes - .map((field) => getOppFields(userHiers, field)[0]) + .map( + (field) => + getOppFields(userHiers, field)?.[0] ?? fallbackOppField(field, "up") + ) .filter((field) => field !== undefined); subGraph = getSubForFields(mainG, [...limitTrailCheckboxes, ...oppFields]); } @@ -42,13 +45,6 @@ function getLimitedTrailSub(plugin: BCPlugin) { return getSubInDirs(closed, "up"); } -function getGraphForTrail(plugin: BCPlugin) { - const { closedG } = plugin; - const { userHiers, limitTrailCheckboxes } = plugin.settings; - - closedG; -} - function getBreadcrumbs( settings: BCSettings, g: MultiGraph,