@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.
- package/dist/abracadabra-provider.cjs +9 -2
- package/dist/abracadabra-provider.cjs.map +1 -1
- package/dist/abracadabra-provider.esm.js +9 -2
- package/dist/abracadabra-provider.esm.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/package.json +1 -1
- package/src/AbracadabraProvider.ts +10 -0
- package/src/AbracadabraWS.ts +10 -2
|
@@ -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)
|
|
2881
|
-
|
|
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);
|