Initial print/export support

This commit is contained in:
lowcarbdev
2025-11-29 21:49:50 -07:00
parent c542c9aebb
commit cc164ef230
6 changed files with 863 additions and 1 deletions
+11
View File
@@ -41,10 +41,21 @@ function LazyMedia({ messageId, mediaType, className, alt = "MMS attachment" })
observerRef.current.observe(imgRef.current)
}
// Load media before printing to ensure all images are available
const handleBeforePrint = () => {
if (!hasLoadedRef.current) {
hasLoadedRef.current = true
loadMedia()
}
}
window.addEventListener('beforeprint', handleBeforePrint)
return () => {
if (observerRef.current) {
observerRef.current.disconnect()
}
window.removeEventListener('beforeprint', handleBeforePrint)
}
}, [messageId])