File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -530,14 +530,14 @@ export class Hocuspocus {
530530 ( ) => {
531531 return this . hooks ( 'onStoreDocument' , hookPayload )
532532 . then ( ( ) => {
533- this . hooks ( 'afterStoreDocument' , hookPayload ) . then ( ( ) => {
533+ this . hooks ( 'afterStoreDocument' , hookPayload ) . then ( async ( ) => {
534534 // Remove document from memory.
535535
536536 if ( document . getConnectionsCount ( ) > 0 ) {
537537 return
538538 }
539539
540- this . unloadDocument ( document )
540+ await this . unloadDocument ( document )
541541 } )
542542 } )
543543 . catch ( error => {
@@ -589,13 +589,13 @@ export class Hocuspocus {
589589 return chain
590590 }
591591
592- unloadDocument ( document : Document ) {
592+ async unloadDocument ( document : Document ) : Promise < any > {
593593 const documentName = document . name
594594 if ( ! this . documents . has ( documentName ) ) return
595595
596596 this . documents . delete ( documentName )
597597 document . destroy ( )
598- this . hooks ( 'afterUnloadDocument' , { instance : this , documentName } )
598+ await this . hooks ( 'afterUnloadDocument' , { instance : this , documentName } )
599599 }
600600
601601 enableDebugging ( ) {
You can’t perform that action at this time.
0 commit comments