From 85bebc97e814d180ce836378101bc819ac9d8d0b Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Sat, 25 Jan 2025 12:16:22 +0100 Subject: [PATCH] Remove redundant code --- src/main.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main.ts b/src/main.ts index 0ba2382..449fff4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -138,21 +138,12 @@ export default class FolderNotesPlugin extends Plugin { this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => { this.handleOverviewBlock(source, el, ctx); }); - - if (this.app.workspace.layoutReady) { - this.registerView(FOLDER_OVERVIEW_VIEW, (leaf: WorkspaceLeaf) => { - return new FolderOverviewView(leaf, this); - }); - } else { - this.app.workspace.onLayoutReady(async () => { - this.registerView(FOLDER_OVERVIEW_VIEW, (leaf: WorkspaceLeaf) => { - return new FolderOverviewView(leaf, this); - }); - }); - } } onLayoutReady() { + this.registerView(FOLDER_OVERVIEW_VIEW, (leaf: WorkspaceLeaf) => { + return new FolderOverviewView(leaf, this); + }); if (this.settings.frontMatterTitle.enabled) { this.fmtpHandler = new FrontMatterTitlePluginHandler(this); } @@ -196,9 +187,7 @@ export default class FolderNotesPlugin extends Plugin { } } return originalHandleDrop.call(this, evt, ...args); - } - - // const fileExplorerPluginInstance = this.app.internalPlugins.getEnabledPluginById(InternalPluginName.FileExplorer); + } }