Skip to content

Commit c48ca51

Browse files
committed
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.
1 parent bb5d617 commit c48ca51

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/editor/TaskCardNoteDecorations.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,14 @@ class TaskCardNoteDecorationsPlugin implements PluginValue {
191191
}
192192
}
193193

194-
private async loadTaskForCurrentFile(view: EditorView) {
194+
private loadTaskForCurrentFile(view: EditorView) {
195195
const file = this.getFileFromView(view);
196196

197197
if (file instanceof TFile) {
198198
try {
199-
const newTask = await this.plugin.cacheManager.getTaskInfo(file.path);
199+
// Use getCachedTaskInfoSync which includes the isTaskFile check
200+
// This will return null if the file is not a task note
201+
const newTask = this.plugin.cacheManager.getCachedTaskInfoSync(file.path);
200202

201203
// Check if task actually changed
202204
const taskChanged =

0 commit comments

Comments
 (0)