@@ -21,6 +21,7 @@ import PopoverReactionList from './ReactionList/PopoverReactionList';
21
21
import getIsReportFullyVisible from '../../../libs/getIsReportFullyVisible' ;
22
22
import { ReactionListContext } from '../ReportScreenContext' ;
23
23
import useInitialValue from '../../../hooks/useInitialValue' ;
24
+ import useReportScrollManager from '../../../hooks/useReportScrollManager' ;
24
25
25
26
const propTypes = {
26
27
/** The report currently being looked at */
@@ -80,6 +81,7 @@ function ReportActionsView(props) {
80
81
81
82
const isFocused = useIsFocused ( ) ;
82
83
const reportID = props . report . reportID ;
84
+ const reportScrollManager = useReportScrollManager ( ) ;
83
85
84
86
/**
85
87
* @returns {Boolean }
@@ -169,8 +171,13 @@ function ReportActionsView(props) {
169
171
* displaying.
170
172
*/
171
173
const loadNewerChats = useMemo (
172
- ( ) =>
173
- _ . throttle ( ( { distanceFromStart} ) => {
174
+ ( ) => {
175
+ return _ . throttle ( ( { distanceFromStart} ) => {
176
+ if ( reportScrollManager . isAutomaticScrollToBottom ) {
177
+ reportScrollManager . isAutomaticScrollToBottom = false ;
178
+ return ;
179
+ }
180
+
174
181
if ( props . isLoadingNewerReportActions || props . isLoadingInitialReportActions ) {
175
182
return ;
176
183
}
@@ -192,8 +199,9 @@ function ReportActionsView(props) {
192
199
193
200
const newestReportAction = _ . first ( props . reportActions ) ;
194
201
Report . getNewerActions ( reportID , newestReportAction . reportActionID ) ;
195
- } , 500 ) ,
196
- [ props . isLoadingNewerReportActions , props . isLoadingInitialReportActions , props . reportActions , reportID ] ,
202
+ } , 500 )
203
+ } ,
204
+ [ props . isLoadingNewerReportActions , props . isLoadingInitialReportActions , props . reportActions , reportID , reportScrollManager ] ,
197
205
) ;
198
206
199
207
/**
0 commit comments