Oliver-Akins / file-hider

A plugin for https://obsidian.md that allows hiding specific files and folders from the file explorer.
MIT License
60 stars 12 forks source link

fix no file / folder hidden when obsidian open #13

Closed Mara-Li closed 2 years ago

Mara-Li commented 2 years ago

See #12

I added a little sleep onLayoutReady because, when Obsidian open, it return null with querySelector. Waiting a little the DOM loading resolve this. I use a 50 ms, but 0 or 1 ms work too. As I was afraid of breaking Obsidian, I prefer to use 50 ms.

I also removed the unnecessary semicolon.

Mara-Li commented 2 years ago

As I use eslint, maybe create an eslint configuration specific for the repo ?

Oliver-Akins commented 2 years ago

Ah, that'd be why, because I don't run eslint, I'll look into possibly adding an eslint config. For now only errors/warnings by the Typescript compiler or that happen directly in the Obsidian dev console are my main concerns.

Mara-Li commented 2 years ago

Hi. I notice this fix doesn't work on mobile. Don't know why :/