Update styles for verified icon

This commit is contained in:
Fedor Indutny 2024-09-24 14:16:51 -07:00 committed by GitHub
parent 03ed42188e
commit 6c38823b50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 111 additions and 8 deletions

View file

@ -1,23 +1,32 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { LocalizerType } from '../types/Util';
import type { ConversationAttributesType } from '../model-types';
export function getAboutText(
attributes: ConversationAttributesType
export function sanitizeAboutText(
text: string | undefined
): string | undefined {
if (!attributes.about) {
return text?.replace(/[✓✔☑√⛉⛊⛛]/g, '');
}
export function getAboutText(
attributes: Pick<ConversationAttributesType, 'about' | 'aboutEmoji'>,
i18n: LocalizerType = window.i18n
): string | undefined {
const text = sanitizeAboutText(attributes.about);
if (!text) {
return undefined;
}
const emoji = attributes.aboutEmoji;
const text = attributes.about;
if (!emoji) {
return text;
}
return window.i18n('icu:message--getNotificationText--text-with-emoji', {
return i18n('icu:message--getNotificationText--text-with-emoji', {
text,
emoji,
});