mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
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:
parent
bb5d617c3a
commit
c48ca51fb0
1 changed files with 4 additions and 2 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Reference in a new issue