Page MenuHomePhabricator

D6613.diff
No OneTemporary

D6613.diff

diff --git a/web/modals/threads/sidebars/sidebar.react.js b/web/modals/threads/sidebars/sidebar.react.js
--- a/web/modals/threads/sidebars/sidebar.react.js
+++ b/web/modals/threads/sidebars/sidebar.react.js
@@ -1,4 +1,5 @@
// @flow
+
import classNames from 'classnames';
import * as React from 'react';
@@ -6,6 +7,7 @@
import type { ChatThreadItem } from 'lib/selectors/chat-selectors';
import { useMessagePreview } from 'lib/shared/message-utils';
import { shortAbsoluteDate } from 'lib/utils/date-utils';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
import Button from '../../../components/button.react';
import { getDefaultTextMessageRules } from '../../../markdown/rules.react';
@@ -65,6 +67,7 @@
);
}, [lastActivity, messagePreviewResult]);
+ const { uiName } = useResolvedThreadInfo(threadInfo);
return (
<Button className={css.sidebarContainer} onClick={onClickThread}>
<img
@@ -77,7 +80,7 @@
alt="sidebar arrow"
/>
<div className={sidebarInfoClassName}>
- <div className={css.longTextEllipsis}>{threadInfo.uiName}</div>
+ <div className={css.longTextEllipsis}>{uiName}</div>
<div className={css.lastMessage}>{lastMessage}</div>
</div>
</Button>
diff --git a/web/modals/threads/subchannels/subchannel.react.js b/web/modals/threads/subchannels/subchannel.react.js
--- a/web/modals/threads/subchannels/subchannel.react.js
+++ b/web/modals/threads/subchannels/subchannel.react.js
@@ -7,6 +7,7 @@
import { type ChatThreadItem } from 'lib/selectors/chat-selectors';
import { useMessagePreview } from 'lib/shared/message-utils';
import { shortAbsoluteDate } from 'lib/utils/date-utils';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
import Button from '../../../components/button.react';
import { getDefaultTextMessageRules } from '../../../markdown/rules.react';
@@ -72,11 +73,12 @@
);
}, [lastActivity, messagePreviewResult]);
+ const { uiName } = useResolvedThreadInfo(threadInfo);
return (
<Button className={css.subchannelContainer} onClick={onClickThread}>
<SWMansionIcon icon="message-square" size={22} />
<div className={subchannelTitleClassName}>
- <div className={css.longTextEllipsis}>{threadInfo.uiName}</div>
+ <div className={css.longTextEllipsis}>{uiName}</div>
<div className={css.lastMessage}>{lastMessage}</div>
</div>
</Button>

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:19 PM (17 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2683150
Default Alt Text
D6613.diff (2 KB)

Event Timeline