fix shape rendering in prod
This commit is contained in:
parent
be6b52a07f
commit
d006fd4fb1
|
|
@ -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
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue