File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ export class QueryRenderer {
4242 // not yet available, so empty.
4343 // - Multi-line properties are supported, but they cannot contain
4444 // continuation lines.
45- // TODO Some of this the following code will need to be repeated in metadataCache.on('changed')
46- // so need to separate out the logic somehow.
4745 const app = this . app ;
4846 const filePath = context . sourcePath ;
4947 const tFile = app . vault . getAbstractFileByPath ( filePath ) ;
@@ -127,7 +125,6 @@ class QueryRenderChild extends MarkdownRenderChild {
127125 return ;
128126 }
129127
130- // TODO We need to debounce this.
131128 this . handleMetadataOrFilePathChange ( filePath , fileCache ) ;
132129 } ) ,
133130 ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ export class QueryResultsRenderer {
4242 public readonly source : string ;
4343
4444 // The path of the file that contains the instruction block, and cached data from that file.
45- // This is updated when the query file's frontmatter is modified.
45+ // This can be updated when the query file's frontmatter is modified.
46+ // It is up to the caller to determine when to do this though.
4647 private _tasksFile : TasksFile ;
4748
4849 public query : IQuery ;
@@ -92,16 +93,13 @@ export class QueryResultsRenderer {
9293 return this . _tasksFile ;
9394 }
9495
96+ /**
97+ * Reload the query with new file information, such as to update query placeholders.
98+ * @param newFile
99+ */
95100 public setTasksFile ( newFile : TasksFile ) {
96- // For now, this always updates the query when the TasksFile changes.
97- // TODO For efficiency, only update if either the path or raw frontmatter has been changed.
98-
99101 this . _tasksFile = newFile ;
100- // Recreate the query, as placeholders and file properties may have changed.
101102 this . query = this . makeQueryFromSourceAndTasksFile ( ) ;
102-
103- // It is up to the caller to ensure that any search results are re-rendered.
104- // TODO Somehow provide information back to the caller to say whether query has been changed.
105103 }
106104
107105 public get filePath ( ) : string | undefined {
You can’t perform that action at this time.
0 commit comments