Skip to content

Commit

Permalink
fix: toolbars showing twice in new notes created from the `Create new…
Browse files Browse the repository at this point in the history
… note` link
  • Loading branch information
chrisgurney committed Dec 20, 2024
1 parent fb21037 commit 3adb475
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,11 @@ export default class NoteToolbarPlugin extends Plugin {
* @param cache CachedMetadata, from which we look at the frontmatter.
*/
metadataCacheListener = (file: TFile, data: any, cache: CachedMetadata) => {
// debugLog("metadata-changed: " + file.name);
debugLog('===== METADATA-CHANGE ===== ', file.name);
const activeFile = this.app.workspace.getActiveFile();
if (activeFile === file) {
const currentView: MarkdownView | null = this.app.workspace.getActiveViewOfType(MarkdownView);
this.lastViewIdOpened = getViewId(currentView) ?? this.lastViewIdOpened;
this.checkAndRenderToolbar(file, cache.frontmatter);
}

Expand Down

0 comments on commit 3adb475

Please sign in to comment.