Moves conversation.getProps out of models
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
a0d7c36e3b
commit
7c1957c30d
21 changed files with 810 additions and 598 deletions
24
ts/util/getAboutText.ts
Normal file
24
ts/util/getAboutText.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ConversationAttributesType } from '../model-types';
|
||||
|
||||
export function getAboutText(
|
||||
attributes: ConversationAttributesType
|
||||
): string | undefined {
|
||||
if (!attributes.about) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const emoji = attributes.aboutEmoji;
|
||||
const text = attributes.about;
|
||||
|
||||
if (!emoji) {
|
||||
return text;
|
||||
}
|
||||
|
||||
return window.i18n('icu:message--getNotificationText--text-with-emoji', {
|
||||
text,
|
||||
emoji,
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue