fix shape rendering in prod
This commit is contained in:
parent
5b32184012
commit
fec80ddd18
|
|
@ -310,7 +310,8 @@ function cleanRichTextNaN(richText: any): any {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimal sanitization - only fix critical issues that break TLDraw
|
// 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 }
|
const sanitized = { ...record }
|
||||||
|
|
||||||
// CRITICAL FIXES ONLY - preserve all other properties
|
// 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
|
// Initial check after a short delay to ensure editor is ready
|
||||||
setTimeout(checkAndFixMissingShapes, 500)
|
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 store changes to continuously monitor for missing shapes
|
||||||
// Listen to ALL sources (user, remote, etc.) to catch shapes loaded from Automerge
|
// Listen to ALL sources (user, remote, etc.) to catch shapes loaded from Automerge
|
||||||
|
let checkTimeout: NodeJS.Timeout | null = null
|
||||||
const unsubscribe = store.store.listen(() => {
|
const unsubscribe = store.store.listen(() => {
|
||||||
// Use consistent debounce for both dev and prod
|
// Use consistent debounce for both dev and prod
|
||||||
setTimeout(checkAndFixMissingShapes, 500)
|
if (checkTimeout) clearTimeout(checkTimeout)
|
||||||
|
checkTimeout = setTimeout(checkAndFixMissingShapes, 500)
|
||||||
})
|
})
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue