fix shape rendering in prod

This commit is contained in:
Jeff Emmett 2025-11-10 19:42:06 -08:00
parent 5b32184012
commit fec80ddd18
3 changed files with 174 additions and 1700 deletions

View File

@ -310,7 +310,8 @@ function cleanRichTextNaN(richText: any): any {
}
// Minimal sanitization - only fix critical issues that break TLDraw
function sanitizeRecord(record: any): TLRecord {
// EXPORTED: Use this same sanitization in production bulk loading to match dev mode behavior
export function sanitizeRecord(record: any): TLRecord {
const sanitized = { ...record }
// CRITICAL FIXES ONLY - preserve all other properties

File diff suppressed because it is too large Load Diff

View File

@ -469,11 +469,17 @@ export function Board() {
// Initial check after a short delay to ensure editor is ready
setTimeout(checkAndFixMissingShapes, 500)
// Also check after shapes are loaded (give more time for initial load)
setTimeout(checkAndFixMissingShapes, 2000)
setTimeout(checkAndFixMissingShapes, 5000)
// Listen to store changes to continuously monitor for missing shapes
// Listen to ALL sources (user, remote, etc.) to catch shapes loaded from Automerge
let checkTimeout: NodeJS.Timeout | null = null
const unsubscribe = store.store.listen(() => {
// Use consistent debounce for both dev and prod
setTimeout(checkAndFixMissingShapes, 500)
if (checkTimeout) clearTimeout(checkTimeout)
checkTimeout = setTimeout(checkAndFixMissingShapes, 500)
})
return () => {