fix cloudflare deployment glitches
This commit is contained in:
parent
04f6fe5192
commit
ab1d0344a5
|
|
@ -432,29 +432,32 @@ export function useAutomergeStoreV2({
|
||||||
const newRecord = isTuple ? recordTuple[1] : recordTuple
|
const newRecord = isTuple ? recordTuple[1] : recordTuple
|
||||||
|
|
||||||
if (!oldRecord || !newRecord) return false
|
if (!oldRecord || !newRecord) return false
|
||||||
if (newRecord.typeName !== 'shape') return false
|
// Check if it's a shape record (not a tuple)
|
||||||
|
const record = newRecord as any
|
||||||
|
if (!record || typeof record !== 'object' || !('typeName' in record)) return false
|
||||||
|
if (record.typeName !== 'shape') return false
|
||||||
|
|
||||||
// Check if only x/y changed
|
// Check if only x/y changed
|
||||||
const oldX = (oldRecord as any).x
|
const oldX = (oldRecord as any).x
|
||||||
const oldY = (oldRecord as any).y
|
const oldY = (oldRecord as any).y
|
||||||
const newX = (newRecord as any).x
|
const newX = record.x
|
||||||
const newY = (newRecord as any).y
|
const newY = record.y
|
||||||
|
|
||||||
// If x/y didn't change, it's not a position update
|
// If x/y didn't change, it's not a position update
|
||||||
if (oldX === newX && oldY === newY) return false
|
if (oldX === newX && oldY === newY) return false
|
||||||
|
|
||||||
// Check if any other properties changed
|
// Check if any other properties changed
|
||||||
for (const key of Object.keys(newRecord)) {
|
for (const key of Object.keys(record)) {
|
||||||
if (key === 'x' || key === 'y') continue
|
if (key === 'x' || key === 'y') continue
|
||||||
if (key === 'props') {
|
if (key === 'props') {
|
||||||
// Deep compare props
|
// Deep compare props - only if both records have props
|
||||||
const oldProps = oldRecord.props || {}
|
const oldProps = (oldRecord as any)?.props || {}
|
||||||
const newProps = newRecord.props || {}
|
const newProps = record?.props || {}
|
||||||
if (JSON.stringify(oldProps) !== JSON.stringify(newProps)) {
|
if (JSON.stringify(oldProps) !== JSON.stringify(newProps)) {
|
||||||
return false // Props changed, not just position
|
return false // Props changed, not just position
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((oldRecord as any)[key] !== (newRecord as any)[key]) {
|
if ((oldRecord as any)[key] !== record[key]) {
|
||||||
return false // Other property changed
|
return false // Other property changed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -641,13 +644,13 @@ export function useAutomergeStoreV2({
|
||||||
recordDetails: allChangedRecords.map(r => {
|
recordDetails: allChangedRecords.map(r => {
|
||||||
let record: any = null
|
let record: any = null
|
||||||
if (r.changeType === 'added' && changes.added) {
|
if (r.changeType === 'added' && changes.added) {
|
||||||
const rec = changes.added[r.id]
|
const rec = (changes.added as any)[r.id]
|
||||||
record = Array.isArray(rec) ? rec[1] : rec
|
record = Array.isArray(rec) ? rec[1] : rec
|
||||||
} else if (r.changeType === 'updated' && changes.updated) {
|
} else if (r.changeType === 'updated' && changes.updated) {
|
||||||
const rec = changes.updated[r.id]
|
const rec = (changes.updated as any)[r.id]
|
||||||
record = Array.isArray(rec) ? rec[1] : rec
|
record = Array.isArray(rec) ? rec[1] : rec
|
||||||
} else if (r.changeType === 'removed' && changes.removed) {
|
} else if (r.changeType === 'removed' && changes.removed) {
|
||||||
const rec = changes.removed[r.id]
|
const rec = (changes.removed as any)[r.id]
|
||||||
record = Array.isArray(rec) ? rec[1] : rec
|
record = Array.isArray(rec) ? rec[1] : rec
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
@ -709,8 +712,9 @@ export function useAutomergeStoreV2({
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (filteredChanges.updated) {
|
if (filteredChanges.updated) {
|
||||||
Object.entries(filteredChanges.updated).forEach(([id, [_, record]]: [string, [any, any]]) => {
|
Object.entries(filteredChanges.updated).forEach(([id, recordTuple]: [string, any]) => {
|
||||||
passingRecords.push({ id, typeName: record?.typeName || 'unknown', changeType: 'updated' })
|
const record = Array.isArray(recordTuple) && recordTuple.length === 2 ? recordTuple[1] : recordTuple
|
||||||
|
passingRecords.push({ id, typeName: (record as any)?.typeName || 'unknown', changeType: 'updated' })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (filteredChanges.removed) {
|
if (filteredChanges.removed) {
|
||||||
|
|
@ -730,36 +734,38 @@ export function useAutomergeStoreV2({
|
||||||
|
|
||||||
// DEBUG: Check for richText/text changes in updated records
|
// DEBUG: Check for richText/text changes in updated records
|
||||||
if (filteredChanges.updated) {
|
if (filteredChanges.updated) {
|
||||||
Object.values(filteredChanges.updated).forEach(([_, record]) => {
|
Object.values(filteredChanges.updated).forEach((recordTuple: any) => {
|
||||||
if (record.typeName === 'shape') {
|
const record = Array.isArray(recordTuple) && recordTuple.length === 2 ? recordTuple[1] : recordTuple
|
||||||
if (record.type === 'geo' && (record.props as any)?.richText) {
|
if ((record as any)?.typeName === 'shape') {
|
||||||
console.log(`🔍 Geo shape ${record.id} richText change detected:`, {
|
const rec = record as any
|
||||||
hasRichText: !!(record.props as any).richText,
|
if (rec.type === 'geo' && rec.props?.richText) {
|
||||||
richTextType: typeof (record.props as any).richText,
|
console.log(`🔍 Geo shape ${rec.id} richText change detected:`, {
|
||||||
|
hasRichText: !!rec.props.richText,
|
||||||
|
richTextType: typeof rec.props.richText,
|
||||||
source: source
|
source: source
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (record.type === 'note' && (record.props as any)?.richText) {
|
if (rec.type === 'note' && rec.props?.richText) {
|
||||||
console.log(`🔍 Note shape ${record.id} richText change detected:`, {
|
console.log(`🔍 Note shape ${rec.id} richText change detected:`, {
|
||||||
hasRichText: !!(record.props as any).richText,
|
hasRichText: !!rec.props.richText,
|
||||||
richTextType: typeof (record.props as any).richText,
|
richTextType: typeof rec.props.richText,
|
||||||
richTextContentLength: Array.isArray((record.props as any).richText?.content)
|
richTextContentLength: Array.isArray(rec.props.richText?.content)
|
||||||
? (record.props as any).richText.content.length
|
? rec.props.richText.content.length
|
||||||
: 'not array',
|
: 'not array',
|
||||||
source: source
|
source: source
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (record.type === 'arrow' && (record.props as any)?.text !== undefined) {
|
if (rec.type === 'arrow' && rec.props?.text !== undefined) {
|
||||||
console.log(`🔍 Arrow shape ${record.id} text change detected:`, {
|
console.log(`🔍 Arrow shape ${rec.id} text change detected:`, {
|
||||||
hasText: !!(record.props as any).text,
|
hasText: !!rec.props.text,
|
||||||
textValue: (record.props as any).text,
|
textValue: rec.props.text,
|
||||||
source: source
|
source: source
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (record.type === 'text' && (record.props as any)?.richText) {
|
if (rec.type === 'text' && rec.props?.richText) {
|
||||||
console.log(`🔍 Text shape ${record.id} richText change detected:`, {
|
console.log(`🔍 Text shape ${rec.id} richText change detected:`, {
|
||||||
hasRichText: !!(record.props as any).richText,
|
hasRichText: !!rec.props.richText,
|
||||||
richTextType: typeof (record.props as any).richText,
|
richTextType: typeof rec.props.richText,
|
||||||
source: source
|
source: source
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -769,13 +775,14 @@ export function useAutomergeStoreV2({
|
||||||
|
|
||||||
// DEBUG: Log added shapes to track what's being created
|
// DEBUG: Log added shapes to track what's being created
|
||||||
if (filteredChanges.added) {
|
if (filteredChanges.added) {
|
||||||
Object.values(filteredChanges.added).forEach((record) => {
|
Object.values(filteredChanges.added).forEach((record: any) => {
|
||||||
if (record.typeName === 'shape') {
|
const rec = Array.isArray(record) ? record[1] : record
|
||||||
console.log(`🔍 Shape added: ${record.type} (${record.id})`, {
|
if (rec?.typeName === 'shape') {
|
||||||
type: record.type,
|
console.log(`🔍 Shape added: ${rec.type} (${rec.id})`, {
|
||||||
id: record.id,
|
type: rec.type,
|
||||||
hasRichText: !!(record.props as any)?.richText,
|
id: rec.id,
|
||||||
hasText: !!(record.props as any)?.text,
|
hasRichText: !!rec.props?.richText,
|
||||||
|
hasText: !!rec.props?.text,
|
||||||
source: source
|
source: source
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export function usePinnedToView(editor: Editor | null, shapeId: string | undefin
|
||||||
// Try to find a valid index higher than existing ones
|
// Try to find a valid index higher than existing ones
|
||||||
const allIndices = allShapes
|
const allIndices = allShapes
|
||||||
.map(s => s.index)
|
.map(s => s.index)
|
||||||
.filter((idx): idx is string => typeof idx === 'string' && /^[a-z]\d+$/.test(idx))
|
.filter((idx): idx is any => typeof idx === 'string' && /^[a-z]\d+$/.test(idx))
|
||||||
.sort()
|
.sort()
|
||||||
|
|
||||||
if (allIndices.length > 0) {
|
if (allIndices.length > 0) {
|
||||||
|
|
@ -192,7 +192,7 @@ export function usePinnedToView(editor: Editor | null, shapeId: string | undefin
|
||||||
// Animation complete - ensure we're exactly at target
|
// Animation complete - ensure we're exactly at target
|
||||||
try {
|
try {
|
||||||
editor.updateShape({
|
editor.updateShape({
|
||||||
id: shapeId,
|
id: shapeId as TLShapeId,
|
||||||
type: currentShape.type,
|
type: currentShape.type,
|
||||||
x: targetX,
|
x: targetX,
|
||||||
y: targetY,
|
y: targetY,
|
||||||
|
|
@ -216,7 +216,7 @@ export function usePinnedToView(editor: Editor | null, shapeId: string | undefin
|
||||||
// Distance is too small, just set directly
|
// Distance is too small, just set directly
|
||||||
try {
|
try {
|
||||||
editor.updateShape({
|
editor.updateShape({
|
||||||
id: shapeId,
|
id: shapeId as TLShapeId,
|
||||||
type: currentShape.type,
|
type: currentShape.type,
|
||||||
x: targetX,
|
x: targetX,
|
||||||
y: targetY,
|
y: targetY,
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ export class FathomMeetingsBrowserShape extends BaseBoxShapeUtil<IFathomMeetings
|
||||||
const handleMeetingSelect = async (
|
const handleMeetingSelect = async (
|
||||||
meeting: any,
|
meeting: any,
|
||||||
options: { summary: boolean; transcript: boolean; actionItems: boolean; video: boolean },
|
options: { summary: boolean; transcript: boolean; actionItems: boolean; video: boolean },
|
||||||
format: 'fathom' | 'note'
|
_format: 'fathom' | 'note'
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
// CRITICAL: Store meeting data immediately to avoid closure issues
|
// CRITICAL: Store meeting data immediately to avoid closure issues
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue