fix(ipc): emoji-image-miss instead of throwing on missing attachment
Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user