From 680b6a53596fa80605895614fb96b2dceff1891c Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 10 Nov 2025 19:44:49 -0800 Subject: [PATCH] update prod --- src/automerge/useAutomergeStoreV2.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/automerge/useAutomergeStoreV2.ts b/src/automerge/useAutomergeStoreV2.ts index db1da65..1f6215f 100644 --- a/src/automerge/useAutomergeStoreV2.ts +++ b/src/automerge/useAutomergeStoreV2.ts @@ -561,8 +561,8 @@ export function useAutomergeStoreV2({ x: s.x, y: s.y, hasProps: !!s.props, - propsW: s.props?.w, - propsH: s.props?.h, + propsW: (s.props as any)?.w, + propsH: (s.props as any)?.h, parentId: s.parentId }))) if (shapesToLoad.length > 20) { @@ -603,8 +603,11 @@ export function useAutomergeStoreV2({ // Verify all shapes have valid parentId pointing to an existing page const pageIds = new Set(pageRecords.map(p => p.id)) const shapesWithInvalidParent = recordsToAdd.filter(r => { - if (r.typeName === 'shape' && r.parentId) { - return !pageIds.has(r.parentId) + if (r.typeName === 'shape') { + const shape = r as any + if (shape.parentId) { + return !pageIds.has(shape.parentId as any) + } } return false }) @@ -613,8 +616,9 @@ export function useAutomergeStoreV2({ console.warn(`⚠️ Found ${shapesWithInvalidParent.length} shapes with invalid parentId, fixing...`) shapesWithInvalidParent.forEach(shape => { const defaultPageId = pageRecords[0]?.id || 'page:page' - console.log(`🔧 Fixing shape ${shape.id}: parentId ${shape.parentId} -> ${defaultPageId}`) - ;(shape as any).parentId = defaultPageId + const shapeRecord = shape as any + console.log(`🔧 Fixing shape ${shapeRecord.id}: parentId ${shapeRecord.parentId} -> ${defaultPageId}`) + shapeRecord.parentId = defaultPageId }) }