From 62b06121f67f93c50ccac5b6f469acc0c599a361 Mon Sep 17 00:00:00 2001 From: Jackie Luo Date: Mon, 28 Mar 2016 16:18:41 -0700 Subject: [PATCH] fix(composer-emoji): Render emoji characters on Windows/Linux --- .../composer-emoji/lib/emoji-button-popover.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal_packages/composer-emoji/lib/emoji-button-popover.jsx b/internal_packages/composer-emoji/lib/emoji-button-popover.jsx index e88195279..451ced989 100644 --- a/internal_packages/composer-emoji/lib/emoji-button-popover.jsx +++ b/internal_packages/composer-emoji/lib/emoji-button-popover.jsx @@ -269,10 +269,7 @@ class EmojiButtonPopover extends React.Component { ctx.fillStyle = 'black'; if (this.state.categorizedEmoji[category].length === 0) return; this.state.categorizedEmoji[category].forEach((emojiName, j) => { - if (process.platform === "darwin" && missingEmojiList.indexOf(emojiName) === -1) { - const emojiChar = emoji.get(emojiName); - ctx.fillText(emojiChar, position.x, position.y); - } else { + if (process.platform === "darwin" && missingEmojiList.indexOf(emojiName) !== -1) { const img = new Image(); img.src = `images/composer-emoji/missing-emoji/${emojiName}.png`; const x = position.x; @@ -280,6 +277,9 @@ class EmojiButtonPopover extends React.Component { img.onload = () => { ctx.drawImage(img, x, y - 30, 32, 32); } + } else { + const emojiChar = emoji.get(emojiName); + ctx.fillText(emojiChar, position.x, position.y); } if (position.x > 325 && j < this.state.categorizedEmoji[category].length - 1) { position.x = 18;