From 2c514720d5a035c44dbeca930ec416ad60087304 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Wed, 2 Dec 2015 12:06:42 -0500 Subject: Fixed emoticon code to use an ES6 map properly --- web/react/utils/emoticons.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/react/utils/emoticons.jsx') diff --git a/web/react/utils/emoticons.jsx b/web/react/utils/emoticons.jsx index 8943e9544..ab04936c0 100644 --- a/web/react/utils/emoticons.jsx +++ b/web/react/utils/emoticons.jsx @@ -116,19 +116,19 @@ function initializeEmoticonMap() { const out = new Map(); for (let i = 0; i < emoticonNames.length; i++) { - out[emoticonNames[i]] = true; + out.set(emoticonNames[i], true); } return out; } -const emoticonMap = initializeEmoticonMap(); +export const emoticonMap = initializeEmoticonMap(); export function handleEmoticons(text, tokens) { let output = text; function replaceEmoticonWithToken(fullMatch, prefix, matchText, name) { - if (emoticonMap[name]) { + if (emoticonMap.has(name)) { const index = tokens.size; const alias = `MM_EMOTICON${index}`; @@ -159,4 +159,4 @@ export function getImagePathForEmoticon(name) { return `/static/images/emoji/${name}.png`; } return `/static/images/emoji`; -} \ No newline at end of file +} -- cgit v1.2.3-1-g7c22