mirror of https://github.com/vector-im/riot-web
Fix error when hovering over non-emoji reactions
Signed-off-by: Robin Townsend <robin@robin.town>pull/21833/head
parent
91cf27e252
commit
aefdac1115
|
@ -79,8 +79,8 @@ function mightContainEmoji(str: string): boolean {
|
|||
* @return {String} The shortcode (such as :thumbup:)
|
||||
*/
|
||||
export function unicodeToShortcode(char: string): string {
|
||||
const shortcodes = getEmojiFromUnicode(char).shortcodes;
|
||||
return shortcodes.length > 0 ? `:${shortcodes[0]}:` : '';
|
||||
const shortcodes = getEmojiFromUnicode(char)?.shortcodes;
|
||||
return shortcodes && shortcodes.length > 0 ? `:${shortcodes[0]}:` : '';
|
||||
}
|
||||
|
||||
export function processHtmlForSending(html: string): string {
|
||||
|
|
Loading…
Reference in New Issue