fix: carousel renders on WhatsApp Web without F5
Two fixes: 1. Stanza type="media" for carousel messages — WhatsApp Web needs this to render carousel in real-time. Without it, only shows header until page refresh (F5). 2. Fix jimp detection: typeof Jimp === 'function' (not just 'object') so jpegThumbnail is generated for card images. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1068,6 +1068,11 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
return 'media'
|
return 'media'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Carousel with images → media type for Web real-time rendering
|
||||||
|
if (normalizedMessage.interactiveMessage?.carouselMessage) {
|
||||||
|
return 'media'
|
||||||
|
}
|
||||||
|
|
||||||
return 'text'
|
return 'text'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export const extractImageThumb = async (bufferOrFilePath: Readable | Buffer | st
|
|||||||
height: dimensions.height
|
height: dimensions.height
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ('jimp' in lib && typeof lib.jimp?.Jimp === 'object') {
|
} else if ('jimp' in lib && (typeof lib.jimp?.Jimp === 'object' || typeof lib.jimp?.Jimp === 'function')) {
|
||||||
const jimp = await (lib.jimp.Jimp as any).read(bufferOrFilePath)
|
const jimp = await (lib.jimp.Jimp as any).read(bufferOrFilePath)
|
||||||
const dimensions = {
|
const dimensions = {
|
||||||
width: jimp.width,
|
width: jimp.width,
|
||||||
|
|||||||
Reference in New Issue
Block a user