Skip to content

Commit

Permalink
get the correct props on removeArrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Galpittel committed Aug 5, 2024
1 parent dec4f05 commit 4d19d95
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class SlideshowView extends React.Component {
return this.state.activeIndex === 0;
}

isScrollStart() {
const { slideAnimation } = this.props.options;
isScrollStart(props = this.props) {
const { slideAnimation } = props.options;

if (
slideAnimation !== GALLERY_CONSTS.slideAnimations.SCROLL ||
Expand All @@ -90,7 +90,7 @@ class SlideshowView extends React.Component {
}

isScrollEnd(props = this.props) {
const { slideshowLoop, slideAnimation } = this.props.options;
const { slideshowLoop, slideAnimation } = props.options;
if (
slideshowLoop ||
slideAnimation === GALLERY_CONSTS.slideAnimations.FADE ||
Expand Down Expand Up @@ -134,10 +134,10 @@ class SlideshowView extends React.Component {
return !this.props.options.slideshowLoop && this.isScrollEnd();
}

isLastItem() {
isLastItem(props = this.props) {
return (
!this.props.options.slideshowLoop &&
this.state.activeIndex >= this.props.totalItemsCount - 1
!props.options.slideshowLoop &&
this.state.activeIndex >= props.totalItemsCount - 1
);
}

Expand Down Expand Up @@ -1218,10 +1218,10 @@ class SlideshowView extends React.Component {
const { isRTL } = props.options;
const { hideLeftArrow, hideRightArrow } = this.state;

const isScrollStart = this.isScrollStart();
const isScrollStart = this.isScrollStart(props);
const isFirstItem = this.isFirstItem();
const isScrollEnd = this.isScrollEnd(props);
const isLastItem = this.isLastItem();
const isLastItem = this.isLastItem(props);

const atStart = isScrollStart || isFirstItem;
const atEnd = isScrollEnd || isLastItem;
Expand Down

0 comments on commit 4d19d95

Please sign in to comment.