update prod
This commit is contained in:
parent
fec80ddd18
commit
680b6a5359
|
|
@ -561,8 +561,8 @@ export function useAutomergeStoreV2({
|
||||||
x: s.x,
|
x: s.x,
|
||||||
y: s.y,
|
y: s.y,
|
||||||
hasProps: !!s.props,
|
hasProps: !!s.props,
|
||||||
propsW: s.props?.w,
|
propsW: (s.props as any)?.w,
|
||||||
propsH: s.props?.h,
|
propsH: (s.props as any)?.h,
|
||||||
parentId: s.parentId
|
parentId: s.parentId
|
||||||
})))
|
})))
|
||||||
if (shapesToLoad.length > 20) {
|
if (shapesToLoad.length > 20) {
|
||||||
|
|
@ -603,8 +603,11 @@ export function useAutomergeStoreV2({
|
||||||
// Verify all shapes have valid parentId pointing to an existing page
|
// Verify all shapes have valid parentId pointing to an existing page
|
||||||
const pageIds = new Set(pageRecords.map(p => p.id))
|
const pageIds = new Set(pageRecords.map(p => p.id))
|
||||||
const shapesWithInvalidParent = recordsToAdd.filter(r => {
|
const shapesWithInvalidParent = recordsToAdd.filter(r => {
|
||||||
if (r.typeName === 'shape' && r.parentId) {
|
if (r.typeName === 'shape') {
|
||||||
return !pageIds.has(r.parentId)
|
const shape = r as any
|
||||||
|
if (shape.parentId) {
|
||||||
|
return !pageIds.has(shape.parentId as any)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
@ -613,8 +616,9 @@ export function useAutomergeStoreV2({
|
||||||
console.warn(`⚠️ Found ${shapesWithInvalidParent.length} shapes with invalid parentId, fixing...`)
|
console.warn(`⚠️ Found ${shapesWithInvalidParent.length} shapes with invalid parentId, fixing...`)
|
||||||
shapesWithInvalidParent.forEach(shape => {
|
shapesWithInvalidParent.forEach(shape => {
|
||||||
const defaultPageId = pageRecords[0]?.id || 'page:page'
|
const defaultPageId = pageRecords[0]?.id || 'page:page'
|
||||||
console.log(`🔧 Fixing shape ${shape.id}: parentId ${shape.parentId} -> ${defaultPageId}`)
|
const shapeRecord = shape as any
|
||||||
;(shape as any).parentId = defaultPageId
|
console.log(`🔧 Fixing shape ${shapeRecord.id}: parentId ${shapeRecord.parentId} -> ${defaultPageId}`)
|
||||||
|
shapeRecord.parentId = defaultPageId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue