From 921514b522786e33e9605a5f493abef9e2d61387 Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Fri, 13 May 2022 13:32:28 -0700 Subject: [PATCH 1/3] Loads more chats fix --- src/pages/home/report/ReportActionsList.js | 5 ++++- src/pages/home/report/ReportActionsView.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsList.js b/src/pages/home/report/ReportActionsList.js index 2648769e0a57..4af69adc6672 100644 --- a/src/pages/home/report/ReportActionsList.js +++ b/src/pages/home/report/ReportActionsList.js @@ -56,6 +56,9 @@ const propTypes = { /** Callback executed on scroll */ onScroll: PropTypes.func.isRequired, + /** Function to load more chats */ + loadMoreChats: PropTypes.func.isRequired, + ...withDrawerPropTypes, ...windowDimensionsPropTypes, }; @@ -165,7 +168,7 @@ class ReportActionsList extends React.Component { keyExtractor={this.keyExtractor} initialRowHeight={32} initialNumToRender={this.calculateInitialNumToRender()} - onEndReached={this.loadMoreChats} + onEndReached={this.props.loadMoreChats} onEndReachedThreshold={0.75} ListFooterComponent={this.props.isLoadingReportActions ? <ActivityIndicator size="small" color={themeColors.spinner} /> diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 877868f0cd82..6c91943cd153 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -417,6 +417,7 @@ class ReportActionsView extends React.Component { sortedReportActions={this.sortedReportActions} mostRecentIOUReportSequenceNumber={this.mostRecentIOUReportSequenceNumber} isLoadingReportActions={this.props.isLoadingReportActions} + loadMoreChats={this.loadMoreChats} /> <PopoverReportActionContextMenu ref={ReportActionContextMenu.contextMenuRef} /> <EmojiPicker ref={EmojiPickerAction.emojiPickerRef} /> From ba54c0b449dc8910daa51f9ace4ea9f1624e2cfd Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Fri, 13 May 2022 13:42:01 -0700 Subject: [PATCH 2/3] binding fix --- src/pages/home/report/ReportActionsView.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 6c91943cd153..007a6a92f658 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -113,6 +113,7 @@ class ReportActionsView extends React.Component { this.recordTimeToMeasureItemLayout = this.recordTimeToMeasureItemLayout.bind(this); this.scrollToBottomAndUpdateLastRead = this.scrollToBottomAndUpdateLastRead.bind(this); this.updateNewMarkerAndMarkReadOnce = _.once(this.updateNewMarkerAndMarkRead.bind(this)); + this.loadMoreChats = _.once(this.loadMoreChats.bind(this)); } componentDidMount() { From 192189dffb7eb4c57bc37598448d5e7ac7ff412d Mon Sep 17 00:00:00 2001 From: chiragsalian <chirag@expensify.com> Date: Fri, 13 May 2022 14:00:48 -0700 Subject: [PATCH 3/3] bind fix --- src/pages/home/report/ReportActionsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 007a6a92f658..ef0520b143f9 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -110,10 +110,10 @@ class ReportActionsView extends React.Component { this.toggleFloatingMessageCounter = this.toggleFloatingMessageCounter.bind(this); this.updateNewMarkerPosition = this.updateNewMarkerPosition.bind(this); this.updateMessageCounterCount = this.updateMessageCounterCount.bind(this); + this.loadMoreChats = this.loadMoreChats.bind(this); this.recordTimeToMeasureItemLayout = this.recordTimeToMeasureItemLayout.bind(this); this.scrollToBottomAndUpdateLastRead = this.scrollToBottomAndUpdateLastRead.bind(this); this.updateNewMarkerAndMarkReadOnce = _.once(this.updateNewMarkerAndMarkRead.bind(this)); - this.loadMoreChats = _.once(this.loadMoreChats.bind(this)); } componentDidMount() {