Page MenuHomePhorge

D9164.1768549175.diff
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

D9164.1768549175.diff

diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js
--- a/native/chat/chat-thread-list.react.js
+++ b/native/chat/chat-thread-list.react.js
@@ -127,6 +127,8 @@
+onChangeSearchText: (searchText: string) => Promise<void>,
+scrollPos: { current: number },
+onScroll: (event: ScrollEvent) => void,
+ +onSwipeableWillOpen: (threadInfo: ThreadInfo) => void,
+ +composeThread: () => void,
};
class ChatThreadList extends React.PureComponent<Props> {
@@ -316,7 +318,7 @@
data={item}
onPressItem={this.onPressItem}
onPressSeeMoreSidebars={this.onPressSeeMoreSidebars}
- onSwipeableWillOpen={this.onSwipeableWillOpen}
+ onSwipeableWillOpen={this.props.onSwipeableWillOpen}
currentlyOpenedSwipeableId={this.props.openedSwipeableID}
/>
);
@@ -393,7 +395,7 @@
<FloatingAction
actions={floatingActions}
overrideWithAction
- onPressItem={this.composeThread}
+ onPressItem={this.props.composeThread}
color="#7e57c2"
/>
);
@@ -458,23 +460,6 @@
params: { threadInfo },
});
};
-
- onSwipeableWillOpen = (threadInfo: ThreadInfo) => {
- this.props.setOpenedSwipeableID(threadInfo.id);
- };
-
- composeThread = () => {
- const { loggedInUserInfo } = this.props;
- if (!loggedInUserInfo) {
- return;
- }
- const threadInfo = createPendingThread({
- viewerID: loggedInUserInfo.id,
- threadType: threadTypes.PRIVATE,
- members: [loggedInUserInfo],
- });
- this.props.navigateToThread({ threadInfo, searching: true });
- };
}
const unboundStyles = {
@@ -604,6 +589,23 @@
[searchStatus],
);
+ const onSwipeableWillOpen = React.useCallback(
+ (threadInfo: ThreadInfo) => setOpenedSwipeableID(threadInfo.id),
+ [],
+ );
+
+ const composeThread = React.useCallback(() => {
+ if (!loggedInUserInfo) {
+ return;
+ }
+ const threadInfo = createPendingThread({
+ viewerID: loggedInUserInfo.id,
+ threadType: threadTypes.PRIVATE,
+ members: [loggedInUserInfo],
+ });
+ navigateToThread({ threadInfo, searching: true });
+ }, [loggedInUserInfo, navigateToThread]);
+
return (
<ChatThreadList
navigation={navigation}
@@ -636,6 +638,8 @@
onChangeSearchText={onChangeSearchText}
scrollPos={scrollPos}
onScroll={onScroll}
+ onSwipeableWillOpen={onSwipeableWillOpen}
+ composeThread={composeThread}
/>
);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 16, 7:39 AM (16 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5942767
Default Alt Text
D9164.1768549175.diff (2 KB)

Event Timeline