From 6aabc78bf25a8851c47a1459dd4c27ab9e241160 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 13 Feb 2015 19:13:03 +0300 Subject: [PATCH] Fixed shortcuts for emoji recent --- app/js/message_composer.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/js/message_composer.js b/app/js/message_composer.js index 7d80fc0a..6573edf7 100644 --- a/app/js/message_composer.js +++ b/app/js/message_composer.js @@ -53,11 +53,13 @@ if (Array.isArray(shortcut)) { shortcut = shortcut[0]; } - if (shortcut.charAt(0) == ':') { - shortcut = shortcut.substr(1, shortcut.length - 2); - } - if (code = shortcuts[shortcut]) { - result.push({code: code, rate: 1}); + if (shortcut && typeof shortcut !== 'string') { + if (shortcut.charAt(0) == ':') { + shortcut = shortcut.substr(1, shortcut.length - 2); + } + if (code = shortcuts[shortcut]) { + result.push({code: code, rate: 1}); + } } } callback(result);