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

@ -1,8 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { getEmojiCount } from '../components/emoji/lib';
import { isEmojiOnlyText } from './isEmojiOnlyText';
import { getEmojiCount, hasNonEmojiText } from '../components/emoji/lib';
type FontSizes = {
diameter: number;
@ -33,7 +32,7 @@ export function getFittedFontSize(
const sizes = getFontSizes(bubbleSize);
let candidateFontSize = sizes.text;
if (isEmojiOnlyText(text) && getEmojiCount(text) === 1) {
if (!hasNonEmojiText(text) && getEmojiCount(text) === 1) {
candidateFontSize = sizes.singleEmoji;
}