jumbo emoji-only message with whitespace

This commit is contained in:
Jamie Kyle 2023-02-06 13:40:49 -08:00 committed by GitHub
parent b6c395fac1
commit 8b5fa7039d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 57 deletions

View file

@ -328,9 +328,13 @@ export function getEmojiCount(str: string): number {
return count;
}
export function hasNonEmojiText(str: string): boolean {
return str.replace(emojiRegex(), '').trim().length > 0;
}
export function getSizeClass(str: string): SizeClassType {
// Do we have non-emoji characters?
if (str.replace(emojiRegex(), '').trim().length > 0) {
if (hasNonEmojiText(str)) {
return '';
}