From b02377f3138136ef21b47b764dd4bd06bc4e2e41 Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Sun, 1 Aug 2021 11:20:36 +0200 Subject: [PATCH] fix(Juggl): :bug: Fix Juggl links not showing The new way of merging Obs & dv cache's together meant that checking if `link.note === file.basename` was comparing it to undefined, so it was never true --- .vscode/settings.json | 3 ++- src/sharedFunctions.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 20b2c29b..7344153c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "conventionalCommits.scopes": [ "CreateIndex", - "Grid View" + "Grid View", + "Juggl" ] } \ No newline at end of file diff --git a/src/sharedFunctions.ts b/src/sharedFunctions.ts index dc9e6af0..69905db2 100644 --- a/src/sharedFunctions.ts +++ b/src/sharedFunctions.ts @@ -94,6 +94,8 @@ export function splitAndDrop(str: string): string[] | [] { ); } +// TODO I think it'd be better to do this whole thing as an obj instead of JugglLink[] +// => {[note: string]: {type: string, linksInLine: string[]}[]} export async function getJugglLinks( app: App, settings: BreadcrumbsSettings @@ -237,10 +239,13 @@ export async function getNeighbourObjArr( .flat(3), ]; - if (plugin.app.plugins.plugins.juggl !== undefined) { + if (jugglLinks.length) { const currFileJugglLinks = jugglLinks.filter( - (link) => link.note === fileFrontmatter.file.basename + (link) => + link.note === + (fileFrontmatter.file.basename || fileFrontmatter.file.name) ); + currFileJugglLinks.forEach((jugglLink) => { jugglLink.links.forEach((link) => { if (parentFields.includes(link.type)) {