Skip to content

Commit

Permalink
modify based on #10, which should fix #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Benature committed May 2, 2024
1 parent 4395282 commit aa5e5dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ Open `Settings` > `Community Plugins` > `Metadata Hider` to set which metadata p
If you find this plugin useful and would like to support its development, you can sponsor me via [Buy Me a Coffee ☕️](https://www.buymeacoffee.com/benature), WeChat, Alipay or [AiFaDian](https://afdian.net/a/Benature-K). Any amount is welcome, thank you!

<p align="center">
<img src="https://s2.loli.net/2024/01/30/jQ9fTSyBxvXRoOM.png" width="500px">
<img src="https://s2.loli.net/2024/04/01/VtX3vYLobdF6MBc.png" width="500px">
</p>
5 changes: 4 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@ export default class MetadataHider extends Plugin {
await this.loadSettings();
this.addSettingTab(new MetadataHiderSettingTab(this.app, this));

this.app.workspace.onLayoutReady(() => {
setTimeout(() => { this.updateCSS(); }, 100);
});
this.registerEvent(this.app.workspace.on('layout-change', () => {
this.app.workspace.onLayoutReady(() => {
setTimeout(() => { this.updateCSS(); }, 1000);
setTimeout(() => { this.hideInAllProperties();; }, 100);
});
}));

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "metadata-hider",
"name": "Metadata Hider",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Hide specific metadata property or if its value is empty.",
"author": "Benature",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ZH = {
export class Locals {
static get() {
const lang = window.localStorage.getItem("language");
switch (lang) {
switch (lang?.toLowerCase()) {
case "zh":
return ZH;
case "zh-tw":
Expand Down

0 comments on commit aa5e5dc

Please sign in to comment.