Skip to content

Commit

Permalink
adding a delay to fix race (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgdgsc authored Jan 3, 2024
1 parent 76cca65 commit b8e5ed4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down

0 comments on commit b8e5ed4

Please sign in to comment.