Add deep diagnostic logging for ViewShot failures

This commit is contained in:
2026-05-31 23:23:02 +02:00
parent ff1e6dc216
commit fb293d840c
+7 -2
View File
@@ -204,12 +204,17 @@ export default function PreviewScreen({
// ── Capture the final image ──
const captureComposite = async (fallbackPhoto: string = currentPhoto) => {
try {
logger.log(`captureComposite started. Has ViewShot ref: ${!!viewShotRef.current}`);
if (viewShotRef.current) {
return await viewShotRef.current.capture();
logger.log('Executing viewShotRef.current.capture()...');
const uri = await viewShotRef.current.capture();
logger.log(`ViewShot successfully generated collage URI: ${uri}`);
return uri;
}
logger.log('[WARNING] viewShotRef.current was null, falling back to raw photo.');
return fallbackPhoto;
} catch (e: any) {
logger.error('Failed to capture composite', e);
logger.error('Failed to capture composite (ViewShot crashed)', e?.message || e);
return fallbackPhoto;
}
};