Skip to content

Commit

Permalink
Get only markdown files when parsing vault
Browse files Browse the repository at this point in the history
This might fix issues #183 #188 #193 but I'm not that confident
  • Loading branch information
flankstaek committed Jan 11, 2025
1 parent 8fd54a1 commit cea69d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const getAllTagsFromMetadata = (cache: CachedMetadata): string[] => {
export const getFileFromPath = (vault: Vault, path: string) => {
let file = vault.getAbstractFileByPath(path)
if (file instanceof TFile) return file
const files = vault.getFiles()
const files = vault.getMarkdownFiles()
file = files.find(e => e.name === path)
if (file instanceof TFile) return file
}
2 changes: 1 addition & 1 deletion src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default class TodoListView extends ItemView {

private async calculateAllItems() {
const todosForUpdatedFiles = await parseTodos(
this.app.vault.getFiles(),
this.app.vault.getMarkdownFiles(),
this.todoTagArray.length === 0 ? ['*'] : this.visibleTodoTagArray,
this.app.metadataCache,
this.app.vault,
Expand Down

0 comments on commit cea69d3

Please sign in to comment.