Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351301
D10646.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10646.diff
View Options
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<RelativeMemberInfo>;
- let memberEntities: $ReadOnlyArray<UserEntity>;
- // 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<RelativeMemberInfo> =
+ threadInfo.members.filter(memberInfo => memberInfo.role);
+ const memberEntities: $ReadOnlyArray<UserEntity> = 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),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 12:54 AM (20 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573327
Default Alt Text
D10646.diff (2 KB)
Attached To
Mode
D10646: [lib] Narrow `threadUIName` to `ThreadInfo`
Attached
Detach File
Event Timeline
Log In to Comment