diff --git a/lib/hooks/inline-sidebar-text.react.js b/lib/hooks/inline-sidebar-text.react.js --- a/lib/hooks/inline-sidebar-text.react.js +++ b/lib/hooks/inline-sidebar-text.react.js @@ -2,16 +2,11 @@ import * as React from 'react'; -import { relativeMemberInfoSelectorForMembersOfThread } from '../selectors/user-selectors'; -import { stringForUser } from '../shared/user-utils'; import type { ThreadInfo } from '../types/thread-types'; -import { useSelector } from '../utils/redux-utils'; -import { pluralizeAndTrim } from '../utils/text-utils'; function useInlineSidebarText( threadInfo: ThreadInfo, ): { - sendersText: string, repliesText: string, } { const repliesCount = threadInfo.repliesCount || 1; @@ -19,22 +14,11 @@ repliesCount > 1 ? 'replies' : 'reply' }`; - const threadMembers = useSelector( - relativeMemberInfoSelectorForMembersOfThread(threadInfo.id), - ); - const sendersText = React.useMemo(() => { - const senders = threadMembers - .filter(member => member.isSender) - .map(stringForUser); - return senders.length > 0 ? `${pluralizeAndTrim(senders, 25)} sent ` : ''; - }, [threadMembers]); - return React.useMemo( () => ({ - sendersText, repliesText, }), - [sendersText, repliesText], + [repliesText], ); } diff --git a/lib/utils/text-utils.js b/lib/utils/text-utils.js --- a/lib/utils/text-utils.js +++ b/lib/utils/text-utils.js @@ -31,17 +31,4 @@ return text.substr(0, maxLength - 3) + '...'; } -function pluralizeAndTrim( - nouns: $ReadOnlyArray, - maxLength: number, -): string { - for (let maxNumberOfNouns = 3; maxNumberOfNouns >= 2; --maxNumberOfNouns) { - const text = pluralize(nouns, maxNumberOfNouns); - if (text.length <= maxLength) { - return text; - } - } - return pluralize(nouns, 1); -} - -export { pluralize, trimText, pluralizeAndTrim }; +export { pluralize, trimText }; diff --git a/native/chat/inline-sidebar.react.js b/native/chat/inline-sidebar.react.js --- a/native/chat/inline-sidebar.react.js +++ b/native/chat/inline-sidebar.react.js @@ -17,7 +17,7 @@ }; function InlineSidebar(props: Props): React.Node { const { threadInfo } = props; - const { sendersText, repliesText } = useInlineSidebarText(threadInfo); + const { repliesText } = useInlineSidebarText(threadInfo); const navigateToThread = useNavigateToThread(); const onPress = React.useCallback(() => { @@ -47,10 +47,7 @@ diff --git a/web/chat/inline-sidebar.react.js b/web/chat/inline-sidebar.react.js --- a/web/chat/inline-sidebar.react.js +++ b/web/chat/inline-sidebar.react.js @@ -14,16 +14,13 @@ }; function InlineSidebar(props: Props): React.Node { const { threadInfo } = props; - const { sendersText, repliesText } = useInlineSidebarText(threadInfo); + const { repliesText } = useInlineSidebarText(threadInfo); const onClick = useOnClickThread(threadInfo); return (
-
- {sendersText} - {repliesText} -
+
{repliesText}
); }