diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -908,23 +908,16 @@ : rawThreadInfo; } -function threadUIName( - threadInfo: LegacyThreadInfo | ThreadInfo, -): string | ThreadEntity { +function threadUIName(threadInfo: ThreadInfo): string | ThreadEntity { if (threadInfo.name) { return firstLine(threadInfo.name); } - let threadMembers: $ReadOnlyArray; - let memberEntities: $ReadOnlyArray; - // Branching below is to appease flow - if (threadInfo.minimallyEncoded) { - threadMembers = threadInfo.members.filter(memberInfo => memberInfo.role); - memberEntities = threadMembers.map(member => ET.user({ userInfo: member })); - } else { - threadMembers = threadInfo.members.filter(memberInfo => memberInfo.role); - memberEntities = threadMembers.map(member => ET.user({ userInfo: member })); - } + const threadMembers: $ReadOnlyArray = + threadInfo.members.filter(memberInfo => memberInfo.role); + const memberEntities: $ReadOnlyArray = threadMembers.map(member => + ET.user({ userInfo: member }), + ); return { type: 'thread', diff --git a/web/modals/threads/settings/thread-settings-modal.react.js b/web/modals/threads/settings/thread-settings-modal.react.js --- a/web/modals/threads/settings/thread-settings-modal.react.js +++ b/web/modals/threads/settings/thread-settings-modal.react.js @@ -54,7 +54,7 @@ deleteThreadLoadingStatusSelector(state) === 'loading' || changeThreadSettingsLoadingStatusSelector(state) === 'loading', ); - const threadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + const threadInfo: ?ThreadInfo = useSelector( state => threadInfoSelector(state)[props.threadID], ); const modalContext = useModalContext(); @@ -70,10 +70,7 @@ if (threadInfo.name === null || threadInfo.name === undefined) { return threadInfo; } - // Branching on `minimallyEncoded` to appease `flow`. - const withNoName = threadInfo.minimallyEncoded - ? { ...threadInfo, name: undefined } - : { ...threadInfo, name: undefined }; + const withNoName = { ...threadInfo, name: undefined }; return { ...withNoName, uiName: threadUIName(withNoName),