fix: task card widget now only appears on actual task notes

The task card widget was appearing on all notes instead of just task notes.
Fixed by using getCachedTaskInfoSync which includes the isTaskFile check,
ensuring the widget only displays for files identified as tasks.
This commit is contained in:
callumalpass 2025-09-28 20:20:43 +10:00
parent bb5d617c3a
commit c48ca51fb0

View file

@ -191,12 +191,14 @@ class TaskCardNoteDecorationsPlugin implements PluginValue {
}
}
private async loadTaskForCurrentFile(view: EditorView) {
private loadTaskForCurrentFile(view: EditorView) {
const file = this.getFileFromView(view);
if (file instanceof TFile) {
try {
const newTask = await this.plugin.cacheManager.getTaskInfo(file.path);
// Use getCachedTaskInfoSync which includes the isTaskFile check
// This will return null if the file is not a task note
const newTask = this.plugin.cacheManager.getCachedTaskInfoSync(file.path);
// Check if task actually changed
const taskChanged =