mirror of
https://github.com/calfmoon/node-factor.git
synced 2026-07-22 05:42:24 +00:00
refactor: rename clearSizeCache() -> recalulateSize()
this represents what the function is doing better
This commit is contained in:
parent
a9b433ba2a
commit
777de23d9a
2 changed files with 8 additions and 8 deletions
10
src/main.ts
10
src/main.ts
|
|
@ -23,17 +23,17 @@ export default class NodeFactor extends Plugin {
|
|||
// create for every existing file when initally loading obsidian
|
||||
// https://docs.obsidian.md/plugins/guides/load-time#Pitfalls
|
||||
this.registerEvent(
|
||||
this.app.vault.on("create", () => this.clearSizeCache()),
|
||||
this.app.vault.on("create", () => this.recalculateSize()),
|
||||
);
|
||||
});
|
||||
this.registerEvent(
|
||||
this.app.vault.on("modify", () => this.clearSizeCache()),
|
||||
this.app.vault.on("modify", () => this.recalculateSize()),
|
||||
);
|
||||
this.registerEvent(
|
||||
this.app.vault.on("delete", () => this.clearSizeCache()),
|
||||
this.app.vault.on("delete", () => this.recalculateSize()),
|
||||
);
|
||||
this.registerEvent(
|
||||
this.app.vault.on("rename", () => this.clearSizeCache()),
|
||||
this.app.vault.on("rename", () => this.recalculateSize()),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ export default class NodeFactor extends Plugin {
|
|||
return size;
|
||||
}
|
||||
|
||||
clearSizeCache() {
|
||||
recalculateSize() {
|
||||
this.sizeCache.clear();
|
||||
this.updateGraph();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export default class NodeFactorSettingTab extends PluginSettingTab {
|
|||
.setDynamicTooltip()
|
||||
.setValue(this.plugin.settings.fwdMultiplier)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.clearSizeCache();
|
||||
this.plugin.recalculateSize();
|
||||
this.plugin.settings.fwdMultiplier = value;
|
||||
await this.plugin.saveSettings();
|
||||
}),
|
||||
|
|
@ -38,7 +38,7 @@ export default class NodeFactorSettingTab extends PluginSettingTab {
|
|||
toggle
|
||||
.setValue(this.plugin.settings.fwdTree)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.clearSizeCache();
|
||||
this.plugin.recalculateSize();
|
||||
this.plugin.settings.fwdTree = value;
|
||||
await this.plugin.saveSettings();
|
||||
}),
|
||||
|
|
@ -53,7 +53,7 @@ export default class NodeFactorSettingTab extends PluginSettingTab {
|
|||
.setDynamicTooltip()
|
||||
.setValue(this.plugin.settings.bwdMultiplier)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.clearSizeCache();
|
||||
this.plugin.recalculateSize();
|
||||
this.plugin.settings.bwdMultiplier = value;
|
||||
await this.plugin.saveSettings();
|
||||
}),
|
||||
|
|
|
|||
Loading…
Reference in a new issue