Skip to content

Commit fb177ad

Browse files
committed
fix missing register event
1 parent 79afb27 commit fb177ad

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

exampleVault/other note.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: asdasds sdf sasdfnosdijn sdaskdjasbokbfosdasdasdasd asd asd
3-
select: option a
2+
title: This is an example of how the meta bind plugin works
3+
select: option c
44
multi-select:
55
- option a
6-
- option c
7-
date: Wednesday, June 6th 2029
6+
- option b
7+
date: Saturday, October 13th 2029
88
time: 19:20
99
---

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ export default class MetaBindPlugin extends Plugin {
6565
}
6666
});
6767

68-
this.app.metadataCache.on('changed', async (file: TFile, data: string, cache: CachedMetadata) => {
68+
this.registerEvent(this.app.metadataCache.on('changed', async (file: TFile, data: string, cache: CachedMetadata) => {
6969
await this.updateMarkdownInputFieldsOnMetadataCacheChange(file, cache);
70-
});
70+
}));
71+
7172

7273
this.addSettingTab(new MetaBindSettingTab(this.app, this));
7374
}

0 commit comments

Comments
 (0)