Skip to content

Commit

Permalink
fix: modifying one file does not return all files
Browse files Browse the repository at this point in the history
  • Loading branch information
waynevanson committed Aug 28, 2023
1 parent ff07158 commit 790a14e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/data-entry/src/hooks/frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export function useFrontmatter(

const read = useCallback(
(file: TFile) => {
if (file.path !== filePath) return;
const data = app.metadataCache.getFileCache(file)?.frontmatter ?? null;
dataSet(data);
},
[app.metadataCache],
[app.metadataCache, filePath],
);

// listen to changes on file when it changes.
Expand Down

0 comments on commit 790a14e

Please sign in to comment.