Skip to content

Commit bf8a6f9

Browse files
committed
fix: bind onUpdate before afterLoadDocument, as changes wont be saved otherwise
1 parent 8f86caf commit bf8a6f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/server/src/Hocuspocus.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ export class Hocuspocus {
377377
}
378378

379379
document.isLoading = false;
380-
await this.hooks("afterLoadDocument", hookPayload);
381380

382381
document.onUpdate(
383382
(document: Document, connection: Connection, update: Uint8Array) => {
@@ -390,6 +389,8 @@ export class Hocuspocus {
390389
},
391390
);
392391

392+
await this.hooks("afterLoadDocument", hookPayload);
393+
393394
document.beforeBroadcastStateless(
394395
(document: Document, stateless: string) => {
395396
const hookPayload: beforeBroadcastStatelessPayload = {

0 commit comments

Comments
 (0)