Page MenuHomePhabricator

D6597.id22010.diff
No OneTemporary

D6597.id22010.diff

diff --git a/native/chat/message-list-header-title.react.js b/native/chat/message-list-header-title.react.js
--- a/native/chat/message-list-header-title.react.js
+++ b/native/chat/message-list-header-title.react.js
@@ -9,6 +9,7 @@
import { View, Platform } from 'react-native';
import type { ThreadInfo } from 'lib/types/thread-types';
+import { useResolvedThreadInfo } from 'lib/utils/entity-helpers';
import { firstLine } from 'lib/utils/string-utils';
import Button from '../components/button.react';
@@ -26,6 +27,7 @@
type Props = {
...BaseProps,
+styles: typeof unboundStyles,
+ +title: string,
};
class MessageListHeaderTitle extends React.PureComponent<Props> {
render() {
@@ -35,6 +37,7 @@
isSearchEmpty,
areSettingsEnabled,
styles,
+ title,
...rest
} = this.props;
@@ -48,8 +51,6 @@
);
}
- const title = isSearchEmpty ? 'New Message' : threadInfo.uiName;
-
return (
<Button
onPress={this.onPress}
@@ -67,7 +68,7 @@
}
onPress = () => {
- const threadInfo = this.props.threadInfo;
+ const { threadInfo } = this.props;
this.props.navigate<'ThreadSettings'>({
name: ThreadSettingsRouteName,
params: { threadInfo },
@@ -106,7 +107,11 @@
function ConnectedMessageListHeaderTitle(props: BaseProps) {
const styles = useStyles(unboundStyles);
- return <MessageListHeaderTitle {...props} styles={styles} />;
+ const { uiName } = useResolvedThreadInfo(props.threadInfo);
+ const { isSearchEmpty } = props;
+ const title = isSearchEmpty ? 'New Message' : uiName;
+
+ return <MessageListHeaderTitle {...props} styles={styles} title={title} />;
},
);

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 4:01 AM (17 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2683397
Default Alt Text
D6597.id22010.diff (1 KB)

Event Timeline