@abraca/dabra 1.3.3 → 1.3.4
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/package.json
CHANGED
package/src/TreeTimestamps.ts
CHANGED
|
@@ -40,9 +40,12 @@ export function attachUpdatedAtObserver(
|
|
|
40
40
|
if (offlineStore !== null && origin === offlineStore) return;
|
|
41
41
|
|
|
42
42
|
// Update the root tree entry (no-op if the entry doesn't exist).
|
|
43
|
-
const
|
|
44
|
-
if (!
|
|
43
|
+
const raw = treeMap.get(childDocId);
|
|
44
|
+
if (!raw) return;
|
|
45
45
|
|
|
46
|
+
// Guard: if the entry is a nested Y.Map (possible after Yrs
|
|
47
|
+
// document compaction), convert to plain object so spread works.
|
|
48
|
+
const entry = raw instanceof Y.Map ? (raw as any).toJSON() : raw;
|
|
46
49
|
treeMap.set(childDocId, { ...entry, updatedAt: Date.now() });
|
|
47
50
|
}
|
|
48
51
|
|