diff --git a/src/main.ts b/src/main.ts index 6b3f691..2f400ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -37,7 +37,7 @@ export default class NodeFactor extends Plugin { ); } - async onunload() {} + onunload() {} private sizeCache: Map = new Map(); private timeoutId: NodeJS.Timeout; @@ -105,13 +105,12 @@ export default class NodeFactor extends Plugin { const childNode: ObsidianNode = value.target; // Prevents looping if A -> B -> C -> D -> B - if (antiLoopSet.has(key)) return size; - - size++; - const childSize = this.fwdNodeTreeSize(childNode, antiLoopSet); - size += childSize; + if (!antiLoopSet.has(key)) { + size++; + const childSize = this.fwdNodeTreeSize(childNode, antiLoopSet); + size += childSize; + } }); - return size; } diff --git a/src/settings.ts b/src/settings.ts index aa84cf9..7210b88 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -62,7 +62,7 @@ export default class NodeFactorSettingTab extends PluginSettingTab { new Setting(containerEl) .setName("Character per weight") .setDesc( - "Add 1 weight to node size per no of given Character (0 to disable).", + "Add 1 weight to node size per no of given character (0 to disable).", ) .addSlider((slider) => slider