Skip to content

Commit

Permalink
perf(CreateIndex): ⚡ Only need allPaths when creating Index, not ever…
Browse files Browse the repository at this point in the history
…y active-note-change
  • Loading branch information
SkepticMystic committed Jul 21, 2021
1 parent 4f0ecd7 commit 16b53c2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/MatrixView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@ export default class MatrixView extends ItemView {
const currFile = this.app.workspace.getActiveFile();
const settings = this.plugin.settings;

// SECTION Create Index

const allPaths = this.dfsAllPaths(
closeImpliedLinks(gChildren, gParents),
currFile.basename
);

// !SECTION Create Index

const viewToggleButton = this.contentEl.createEl("button", {
text: this.matrixQ ? "List" : "Matrix",
});
Expand All @@ -196,6 +187,10 @@ export default class MatrixView extends ItemView {
text: "Create Index ⚠️",
});
createIndexButton.addEventListener("click", () => {
const allPaths = this.dfsAllPaths(
closeImpliedLinks(gChildren, gParents),
currFile.basename
);
const index = this.createIndex(allPaths, currFile.basename, settings);
debug(settings, { index });
copyToClipboard(index);
Expand Down

0 comments on commit 16b53c2

Please sign in to comment.