Skip to content

Commit

Permalink
minor updates for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JediWattson committed Jan 16, 2023
1 parent 50143fb commit c97a7dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/AttachmentCarousel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import CarouselActions from './CarouselActions';
import Button from '../Button';
import * as ReportActionsUtils from '../../libs/ReportActionsUtils';
import * as Report from '../../libs/actions/Report';

import AttachmentView from '../AttachmentView';
import addEncryptedAuthTokenToURL from '../../libs/addEncryptedAuthTokenToURL';
import * as DeviceCapabilities from '../../libs/DeviceCapabilities';
Expand Down Expand Up @@ -160,6 +159,8 @@ class AttachmentCarousel extends React.Component {

this.setState(({attachments, page}) => {
const nextIndex = page + deltaSlide;

// Check if index is near the end of the list to fetch more reports
if (attachments.length - nextIndex < 10) {
Report.loadMoreActions(this.props.report.reportID, this.props.reportActions, this.props.report.isLoadingMoreReportActions);
}
Expand Down

0 comments on commit c97a7dc

Please sign in to comment.