Fix (undefined)

This commit is contained in:
Lorenz Padberg 2024-05-16 00:27:16 +02:00
parent e23549c677
commit dedd7feea5
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ const emit = defineEmits(['input']);
const containsEmoji = (text: string) => {
const lastCharacter = Array.from(text)[Array.from(text).length - 1];
if (lastCharacter.charCodeAt(0)> 55000) //fix for the hand symbol 🖐
if (lastCharacter && lastCharacter.charCodeAt(0)> 55000) //fix for the hand symbol 🖐
return true
const emojiRegex = /\p{Emoji}/u;
return emojiRegex.test(lastCharacter);