Skip to content

Commit

Permalink
fix(Juggl): 🐛 Fix Juggl links not showing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SkepticMystic committed Aug 1, 2021
1 parent 4d9a0d2 commit b02377f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"conventionalCommits.scopes": [
"CreateIndex",
"Grid View"
"Grid View",
"Juggl"
]
}
9 changes: 7 additions & 2 deletions src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit b02377f

Please sign in to comment.