From 07146591dd8b5aa50bbe4b33eb729d52d0a02247 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 8 Apr 2022 03:18:47 -0400 Subject: [PATCH] Pad: Run `padLoad` hook asynchronously --- CHANGELOG.md | 1 + src/node/db/Pad.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a991ef5..b6db5e47b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ * `padCreate`: The `author` context property is deprecated; use the new `authorId` context property instead. * `padLoad`: Now runs when a temporary Pad object is created during import. + Also, it now runs asynchronously. * `padRemove`: The `padID` context property is deprecated; use `pad.id` instead. * `padUpdate`: The `author` context property is deprecated; use the new diff --git a/src/node/db/Pad.js b/src/node/db/Pad.js index 8e824eaac..62baf1a9e 100644 --- a/src/node/db/Pad.js +++ b/src/node/db/Pad.js @@ -395,7 +395,7 @@ Pad.prototype.init = async function (text, authorId = '') { const firstChangeset = Changeset.makeSplice('\n', 0, 0, text); await this.appendRevision(firstChangeset, authorId); } - hooks.callAll('padLoad', {pad: this}); + await hooks.aCallAll('padLoad', {pad: this}); }; Pad.prototype.copy = async function (destinationID, force) {