Page MenuHomePhabricator

D13275.diff
No OneTemporary

D13275.diff

diff --git a/native/chat/message-list-container.react.js b/native/chat/message-list-container.react.js
--- a/native/chat/message-list-container.react.js
+++ b/native/chat/message-list-container.react.js
@@ -18,6 +18,7 @@
useExistingThreadInfoFinder,
} from 'lib/shared/thread-utils.js';
import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import { threadTypeIsThick } from 'lib/types/thread-types-enum.js';
import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js';
import { pinnedMessageCountText } from 'lib/utils/message-pinning-utils.js';
@@ -163,7 +164,16 @@
// It's technically possible for the client to be missing the Genesis
// ThreadInfo when it first opens up (before the server delivers it)
let parentThreadHeader;
- if (genesisThreadInfo) {
+ if (threadTypeIsThick(threadInfo.type)) {
+ parentThreadHeader = (
+ <ParentThreadHeader
+ childThreadType={pendingThreadType(
+ userInfoInputArray.length,
+ 'thick',
+ )}
+ />
+ );
+ } else if (genesisThreadInfo) {
parentThreadHeader = (
<ParentThreadHeader
parentThreadInfo={genesisThreadInfo}
diff --git a/native/chat/parent-thread-header.react.js b/native/chat/parent-thread-header.react.js
--- a/native/chat/parent-thread-header.react.js
+++ b/native/chat/parent-thread-header.react.js
@@ -14,7 +14,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +parentThreadInfo: ThreadInfo,
+ +parentThreadInfo?: ThreadInfo,
+childThreadType: ThreadType,
};
function ParentThreadHeader(props: Props): React.Node {
@@ -26,9 +26,24 @@
const navigateToThread = useNavigateToThread();
const onPressParentThread = React.useCallback(() => {
+ if (!parentThreadInfo) {
+ return;
+ }
navigateToThread({ threadInfo: parentThreadInfo });
}, [parentThreadInfo, navigateToThread]);
+ let parentThreadButton;
+ if (parentThreadInfo) {
+ parentThreadButton = (
+ <>
+ <Text style={styles.within}>within</Text>
+ <Button onPress={onPressParentThread}>
+ <CommunityPill community={parentThreadInfo} />
+ </Button>
+ </>
+ );
+ }
+
return (
<View style={styles.container}>
<ScrollView
@@ -40,10 +55,7 @@
threadType={childThreadType}
color={threadVisibilityColor}
/>
- <Text style={styles.within}>within</Text>
- <Button onPress={onPressParentThread}>
- <CommunityPill community={parentThreadInfo} />
- </Button>
+ {parentThreadButton}
</ScrollView>
</View>
);

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 12:05 PM (19 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694639
Default Alt Text
D13275.diff (2 KB)

Event Timeline