Skip to content

Commit

Permalink
fix(Juggl): 🐛 Use typedLinkPrefix from Juggl if installed, fall back …
Browse files Browse the repository at this point in the history
…on '-' otherwise
  • Loading branch information
SkepticMystic committed Aug 14, 2021
1 parent 09d8d98 commit 16af4dc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ export async function getJugglLinks(
?.map((link) => link.slice(2, link.length - 2))
?.map((innerText) => innerText.split("|")[0]) ?? [];

const parsedLinks = parseTypedLink(link, line, "-");
const typedLinkPrefix =
app.plugins.plugins.juggl?.settings.typedLinkPrefix ?? "-";

const parsedLinks = parseTypedLink(link, line, typedLinkPrefix);

const type = parsedLinks?.properties?.type ?? "";
let typeDir: Directions | "" = "";
Expand Down Expand Up @@ -269,15 +272,15 @@ export async function getNeighbourObjArr(

// Add regular metadata links
if (plugin.settings.useAllMetadata) {
DIRECTIONS.forEach((dir, i) => {
fieldsArr[i].forEach((field) => {
newHier[dir][field] = getFieldValues(
fileFrontmatter,
field,
plugin.settings
);
DIRECTIONS.forEach((dir, i) => {
fieldsArr[i].forEach((field) => {
newHier[dir][field] = getFieldValues(
fileFrontmatter,
field,
plugin.settings
);
});
});
});
}

// Add Juggl Links
Expand Down Expand Up @@ -473,7 +476,6 @@ export function mergeGraphs(g1: Graph, g2: Graph) {
}

export function mergeGs(...graphs: Graph[]) {
// console.trace("mergeGs");
const outG = new Graph();
graphs.forEach((graph) => {
graph.edges().forEach((edge) => {
Expand Down

0 comments on commit 16af4dc

Please sign in to comment.