fix(ipc): emoji-image-miss instead of throwing on missing attachment

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-23 04:23:17 -04:00
co-authored by Cursor
parent 1aec691a24
commit f4d580743d
+19 -2
View File
@@ -957,8 +957,25 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
return true
}
if (t === 'request-emoji-image') {
const preview = await platform.readEmojiImage(msg.name || msg.attachmentId)
send({ type: 'emoji-image', preview, emojiName: msg.name || null })
const attachmentId = msg.attachmentId || null
const emojiName = msg.name || null
try {
const preview = await platform.readEmojiImage(emojiName || attachmentId)
if (preview) {
send({ type: 'emoji-image', preview, emojiName })
} else {
flowLog.debug('emoji image miss', { attachmentId, emojiName })
send({ type: 'emoji-image-miss', attachmentId, emojiName })
}
} catch (err) {
flowLog.warn('emoji image request failed', { attachmentId, emojiName, err })
send({
type: 'emoji-image-miss',
attachmentId,
emojiName,
message: err?.message || String(err)
})
}
return true
}
if (t === 'stage-guild-emoji-image') {