mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
29 lines
571 B
TypeScript
29 lines
571 B
TypeScript
// Copyright 2023 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { ConversationAttributesType } from '../model-types.d.ts';
|
|
|
|
export function getAboutText(
|
|
attributes: Pick<ConversationAttributesType, 'about' | 'aboutEmoji'>
|
|
): string | undefined {
|
|
const text = attributes.about;
|
|
|
|
if (!text) {
|
|
return undefined;
|
|
}
|
|
|
|
const emoji = attributes.aboutEmoji;
|
|
|
|
if (!emoji) {
|
|
return text;
|
|
}
|
|
|
|
return window.SignalContext.i18n(
|
|
'icu:message--getNotificationText--text-with-emoji',
|
|
{
|
|
text,
|
|
emoji,
|
|
}
|
|
);
|
|
}
|