signal-desktop/ts/util/getAboutText.ts

26 lines
534 B
TypeScript
Raw Normal View History

// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationAttributesType } from '../model-types';
export function getAboutText(
2024-10-08 03:15:50 +00:00
attributes: Pick<ConversationAttributesType, 'about' | 'aboutEmoji'>
): string | undefined {
2024-10-08 03:15:50 +00:00
const text = attributes.about;
2024-09-24 21:16:51 +00:00
if (!text) {
return undefined;
}
const emoji = attributes.aboutEmoji;
if (!emoji) {
return text;
}
2024-10-08 03:15:50 +00:00
return window.i18n('icu:message--getNotificationText--text-with-emoji', {
text,
emoji,
});
}