summaryrefslogtreecommitdiffstats
path: root/web/react/utils/emoticons.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils/emoticons.jsx')
-rw-r--r--web/react/utils/emoticons.jsx8
1 files changed, 4 insertions, 4 deletions
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
+}