Skip to content

Commit

Permalink
Potential fix for #50
Browse files Browse the repository at this point in the history
  • Loading branch information
chhoumann committed Jan 19, 2022
1 parent c7079a9 commit 41c8255
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/automators/onFileModifyAutomatorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ export class OnFileModifyAutomatorManager implements IAutomatorManager {
const outfile: TFile = abstractFileToMarkdownTFile(file);
if (!outfile) return;

// Return on Excalidraw files to prevent conflict with its auto-save feature.
const metadata = await this.app.metadataCache.getFileCache(outfile);
const keys = Object.keys(metadata?.frontmatter);
if (keys && keys.some(key => key.toLowerCase().contains("excalidraw"))) {
return;
}

const fileContent: string = await this.app.vault.cachedRead(outfile);
if (!this.updatedFileCache.set(outfile.path, fileContent)) return;

Expand Down

0 comments on commit 41c8255

Please sign in to comment.