Skip to content

Commit

Permalink
registeredEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
SashaKryzh committed Oct 8, 2024
1 parent 3987c44 commit 74f64f7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ export default class VaultReviewPlugin extends Plugin {
this.addSettingTab(new VaultReviewSettingTab(this.app, this));

// Events
this.app.vault.on("rename", this.handleFileRename);
this.app.vault.on("delete", this.handleFileDelete);
this.registerEvent(this.app.vault.on("rename", this.handleFileRename));
this.registerEvent(this.app.vault.on("delete", this.handleFileDelete));
this.registerEvent(
this.app.workspace.on("file-open", this.statusBar.update)
);
};

onunload = () => {};
Expand Down Expand Up @@ -329,9 +332,7 @@ class StatusBar {

element.createSpan("status").setText("Not reviewed");
element.addClass("mod-clickable");

this.element.addEventListener("click", this.onClick);
this.plugin.app.workspace.on("file-open", this.update);
element.addEventListener("click", this.onClick);

this.update();
}
Expand Down

0 comments on commit 74f64f7

Please sign in to comment.