@abraca/dabra 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2840,6 +2840,7 @@ var AbracadabraProvider = class AbracadabraProvider extends AbracadabraBaseProvi
2840
2840
  this.childAccessTimes = /* @__PURE__ */ new Map();
2841
2841
  this.pinnedChildren = /* @__PURE__ */ new Set();
2842
2842
  this.boundHandleYSubdocsChange = this.handleYSubdocsChange.bind(this);
2843
+ this.hasCachedContent = false;
2843
2844
  this._client = client;
2844
2845
  this.abracadabraConfig = configuration;
2845
2846
  this.subdocLoading = configuration.subdocLoading ?? "lazy";
@@ -2877,8 +2878,14 @@ var AbracadabraProvider = class AbracadabraProvider extends AbracadabraBaseProvi
2877
2878
  async _initFromOfflineStore() {
2878
2879
  if (!this.offlineStore) return;
2879
2880
  const [snapshot, pending] = await Promise.all([this.offlineStore.getDocSnapshot().catch(() => null), this.offlineStore.getPendingUpdates().catch(() => [])]);
2880
- if (snapshot) yjs.applyUpdate(this.document, snapshot, this.offlineStore);
2881
- for (const update of pending) yjs.applyUpdate(this.document, update, this.offlineStore);
2881
+ if (snapshot) {
2882
+ yjs.applyUpdate(this.document, snapshot, this.offlineStore);
2883
+ this.hasCachedContent = true;
2884
+ }
2885
+ for (const update of pending) {
2886
+ yjs.applyUpdate(this.document, update, this.offlineStore);
2887
+ this.hasCachedContent = true;
2888
+ }
2882
2889
  }
2883
2890
  authenticatedHandler(scope) {
2884
2891
  super.authenticatedHandler(scope);