handle local/remote autoload edge cases

This commit is contained in:
Kevin Jahns
2021-11-19 13:27:14 +01:00
parent 9df5016667
commit 4154b12f14
3 changed files with 101 additions and 6 deletions

View File

@@ -132,4 +132,8 @@ export class ContentDoc {
* @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
* @return {ContentDoc}
*/
export const readContentDoc = decoder => new ContentDoc(new Doc({ guid: decoder.readString(), ...decoder.readAny() }))
export const readContentDoc = decoder => {
const guid = decoder.readString()
const opts = decoder.readAny()
return new ContentDoc(new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false }))
}