Page MenuHomePhabricator

D6665.id22291.diff
No OneTemporary

D6665.id22291.diff

diff --git a/native/chat/chat-context-provider.react.js b/native/chat/chat-context-provider.react.js
--- a/native/chat/chat-context-provider.react.js
+++ b/native/chat/chat-context-provider.react.js
@@ -36,7 +36,7 @@
const measureMessages = React.useCallback(
(
- messages: $ReadOnlyArray<ChatMessageItem>,
+ messages: ?$ReadOnlyArray<ChatMessageItem>,
threadInfo: ?ThreadInfo,
onMessagesMeasured: ($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,
measurerID: number,
@@ -48,6 +48,10 @@
return;
}
+ if (!messages) {
+ return;
+ }
+
const measureCallback = (
messagesWithHeight: $ReadOnlyArray<ChatMessageItemWithHeight>,
newMeasuredHeights: $ReadOnlyMap<string, number>,
@@ -88,7 +92,7 @@
const measurerID = nextMeasurerID.current++;
return {
measure: (
- messages: $ReadOnlyArray<ChatMessageItem>,
+ messages: ?$ReadOnlyArray<ChatMessageItem>,
threadInfo: ?ThreadInfo,
onMessagesMeasured: (
$ReadOnlyArray<ChatMessageItemWithHeight>,
diff --git a/native/chat/chat-context.js b/native/chat/chat-context.js
--- a/native/chat/chat-context.js
+++ b/native/chat/chat-context.js
@@ -10,7 +10,7 @@
import type { ChatMessageItemWithHeight } from '../types/chat-types';
export type MessagesMeasurer = (
- $ReadOnlyArray<ChatMessageItem>,
+ ?$ReadOnlyArray<ChatMessageItem>,
?ThreadInfo,
($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,
) => void;
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
@@ -58,7 +58,7 @@
+userSearchResults: $ReadOnlyArray<UserListItem>,
+threadInfo: ThreadInfo,
+genesisThreadInfo: ?ThreadInfo,
- +messageListData: $ReadOnlyArray<ChatMessageItem>,
+ +messageListData: ?$ReadOnlyArray<ChatMessageItem>,
+colors: Colors,
+styles: typeof unboundStyles,
// withOverlayContext
@@ -327,10 +327,6 @@
userInfoInputArray,
threadInfo,
});
- invariant(
- messageListData,
- 'messageListData must be specified in messageListContainer',
- );
const colors = useColors();
const styles = useStyles(unboundStyles);
const overlayContext = React.useContext(OverlayContext);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 1:55 PM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2677205
Default Alt Text
D6665.id22291.diff (2 KB)

Event Timeline