fix: Share modal not working in year-in-review (#13079)

This commit is contained in:
Sivin Varghese
2025-12-16 12:32:52 +05:30
committed by GitHub
parent bb8bafe3dc
commit 68d8e62a5c

View File

@@ -56,15 +56,19 @@ const generateImage = async () => {
const bgColor = colorMap[props.slideBackground] || '#ffffff';
const dataUrl = await toPng(slideElement, {
quality: 2,
pixelRatio: 1.2,
backgroundColor: bgColor,
// Skip font/CSS embedding to avoid CORS issues with CDN stylesheets
// See: https://github.com/bubkoo/html-to-image/issues/49#issuecomment-762222100
fontEmbedCSS: '',
cacheBust: true,
});
const img = new Image();
img.src = dataUrl;
await new Promise(resolve => {
await new Promise((resolve, reject) => {
img.onload = resolve;
img.onerror = reject;
});
const finalCanvas = document.createElement('canvas');