0
0
Fork 0

fix: resolve requested change

This commit is contained in:
Mara 2022-06-11 19:24:16 +02:00
parent 50cc33a604
commit e6f192c7fc
2 changed files with 3 additions and 2 deletions

View file

@ -19,6 +19,7 @@ export default class FileHider extends Plugin {
style: CSSStyleSheet|null = null; style: CSSStyleSheet|null = null;
async onload() { async onload() {
await this.loadSettings(); await this.loadSettings();
this.registerEvent( this.registerEvent(
this.app.workspace.on(`file-menu`, (menu, file) => { 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) await sleep(50)
for (const path of this.settings.hiddenList) { for (const path of this.settings.hiddenList) {
await changePathVisibility(path, this.settings.hidden); await changePathVisibility(path, this.settings.hidden);

View file

@ -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}"]`); let n = document.querySelector(`[data-path="${path}"]`);
if (!n) { if (!n) {
return; return;