Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// 偶尔出现没有图片需要上传,但是部分字段需要调整的情况
if (!isImageAttached && formDataJson.action === API_ACTION_UPLOAD_IMAGE) {
formDataJson.action = API_ACTION_PLAIN_MESSAGE
formDataJson.content = formDataJson.desc
}
if (isImageAttached) {
delete formDataJson.content
} else {
delete formDataJson.desc
delete formDataJson.photo_base64
delete formDataJson.picture
}
formDataJson = flush(formDataJson)
return { isImageAttached, formDataJson }
}
.then(({results}) => {
const smartEmojis = flush(results.map(({text}) => {
return getEmojiDetailsFromEmoji(text)
}))
const suggestions = uniqBy(smartEmojis.concat(filtered), 'short_name')
const presentSuggestions = suggestions.filter(x => !!getEmoji(x.short_name))
cb(presentSuggestions)
})
.catch(error => {