From b8e5ed424c1fdc5d1a69eac9666eb4096a7de71f Mon Sep 17 00:00:00 2001 From: xgdgsc Date: Thu, 4 Jan 2024 01:48:15 +0800 Subject: [PATCH] adding a delay to fix race (#279) --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index 26adc13..9a0455d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -580,6 +580,7 @@ export default class DiceRollerPlugin extends Plugin { if (!file || !(file instanceof TFile)) return; if (replacementFound && modPromises.length) { await Promise.all(modPromises); + sleep(500) await this.app.vault.modify(file, fileContent.join("\n")); }