diff --git a/lib/shared/notif-utils.js b/lib/shared/notif-utils.js --- a/lib/shared/notif-utils.js +++ b/lib/shared/notif-utils.js @@ -17,7 +17,9 @@ import { ET, getEntityTextAsString, + pluralizeEntityText, type EntityText, + type UserEntity, } from '../utils/entity-text'; import { promiseAll } from '../utils/promises'; import { trimText } from '../utils/text-utils'; @@ -96,7 +98,7 @@ +threadType: ThreadType, +parentThreadInfo: ThreadInfo, +childThreadName: ?string, - +childThreadUIName: EntityText | string, + +childThreadUIName: string | $ReadOnlyArray, }; function notifTextsForSubthreadCreation( input: NotifTextsForSubthreadCreationInput, @@ -179,10 +181,15 @@ ); return notifString; }; + const unresolvedTitle = unresolvedNotifTexts.title; + const pluralizedTitle = + typeof unresolvedTitle === 'string' + ? unresolvedTitle + : pluralizeEntityText(unresolvedTitle.map(entity => [entity])); let promises = { merged: resolveToString(unresolvedNotifTexts.merged), body: resolveToString(unresolvedNotifTexts.body), - title: resolveToString(unresolvedNotifTexts.title), + title: resolveToString(pluralizedTitle), }; if (unresolvedNotifTexts.prefix) { promises = { diff --git a/lib/types/notif-types.js b/lib/types/notif-types.js --- a/lib/types/notif-types.js +++ b/lib/types/notif-types.js @@ -1,11 +1,11 @@ // @flow -import type { EntityText } from '../utils/entity-text'; +import type { EntityText, UserEntity } from '../utils/entity-text'; export type NotifTexts = { +merged: string | EntityText, +body: string | EntityText, - +title: string | EntityText, + +title: string | $ReadOnlyArray, +prefix?: string | EntityText, };