Merge pull request #587 from SamyPesse/patch-1

Only emit "load" when sync is set to true
This commit is contained in:
Kevin Jahns 2023-11-20 12:36:25 +01:00 committed by GitHub
commit 5861876e6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,7 +113,7 @@ export class Doc extends Observable {
this.whenSynced = provideSyncedPromise() this.whenSynced = provideSyncedPromise()
} }
this.isSynced = isSynced === undefined || isSynced === true this.isSynced = isSynced === undefined || isSynced === true
if (!this.isLoaded) { if (this.isSynced && !this.isLoaded) {
this.emit('load', []) this.emit('load', [])
} }
}) })