Skip to content

Commit 28791d7

Browse files
committed
fix: Ignore rename events for other files (#3335, #3428)
QueryRenderer now only listens out for renames to the file containing the query, rather than to any file in the vault. Fixes #3335 Fixes #3428
1 parent ea48257 commit 28791d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Renderer/QueryRenderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,11 @@ class QueryRenderChild extends MarkdownRenderChild {
150150
);
151151

152152
this.registerEvent(
153-
this.app.vault.on('rename', (tFile: TAbstractFile, _oldPath: string) => {
153+
this.app.vault.on('rename', (tFile: TAbstractFile, oldPath: string) => {
154+
if (oldPath !== this.queryResultsRenderer.filePath) {
155+
return;
156+
}
157+
154158
let fileCache: CachedMetadata | null = null;
155159
if (tFile && tFile instanceof TFile) {
156160
fileCache = this.app.metadataCache.getFileCache(tFile);

0 commit comments

Comments
 (0)