From e6f192c7fca74c73c07090c9c6c35e5801098f17 Mon Sep 17 00:00:00 2001 From: Mara Date: Sat, 11 Jun 2022 19:24:16 +0200 Subject: [PATCH] fix: resolve requested change --- src/main.ts | 3 ++- src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 3419f35..2e8e18e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,6 +19,7 @@ export default class FileHider extends Plugin { style: CSSStyleSheet|null = null; async onload() { + await this.loadSettings(); this.registerEvent( this.app.workspace.on(`file-menu`, (menu, file) => { @@ -63,7 +64,7 @@ export default class FileHider extends Plugin { ); - this.app.workspace.onLayoutReady( async () => { + this.app.workspace.onLayoutReady(async () => { await sleep(50) for (const path of this.settings.hiddenList) { await changePathVisibility(path, this.settings.hidden); diff --git a/src/utils.ts b/src/utils.ts index f32f85c..7a044d4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,4 @@ -export async function changePathVisibility(path: string, hide: boolean) { +export function changePathVisibility(path: string, hide: boolean) { let n = document.querySelector(`[data-path="${path}"]`); if (!n) { return;