Skip to content

Commit

Permalink
fix: Null check on ff in targetOrder
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jun 4, 2022
1 parent 7edc8ed commit 59f70ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class HierarchyNoteManipulator extends FuzzySuggestModal<HNItem> {
const { editor } = view ?? {};
if (!editor) return;
//@ts-ignore
view.leaf.openFile(this.file, { active: true, mode: "source" });
await view.leaf.openFile(this.file, { active: true, mode: "source" });
editor.setCursor({ line: item.lineNo, ch: item.depth + 2 });
} else if (evt instanceof KeyboardEvent || evt instanceof MouseEvent) {
let rel: "up" | "down" | "same";
Expand Down
8 changes: 4 additions & 4 deletions src/Utils/graphUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export function dfsAllPaths(g: MultiGraph, start: string): string[][] {
const extPath = [node, ...path];
const succsNotVisited = g.hasNode(node)
? g.filterOutNeighbors(
node,
(succ) => !visited[succ] || visited[succ] < 5
)
node,
(succ) => !visited[succ] || visited[succ] < 5
)
: [];
const newItems = succsNotVisited.map((succ) => {
visited[succ] = visited[succ] ? visited[succ] + 1 : 1;
Expand Down Expand Up @@ -308,7 +308,7 @@ export function populateMain(

export const getTargetOrder = (frontms: dvFrontmatterCache[], target: string) =>
parseInt(
(frontms.find((arr) => arr.file.basename === target)?.[
(frontms.find((ff) => ff?.file?.basename === target)?.[
BC_ORDER
] as string) ?? "9999"
);
Expand Down

0 comments on commit 59f70ee

Please sign in to comment.