Skip to content

Commit

Permalink
fix: Fixed Swipe setTimeout function call bug
Browse files Browse the repository at this point in the history
  • Loading branch information
myxvisual committed Jun 23, 2017
1 parent 6e09b6c commit 39ee3f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Swipe/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class Swipe extends React.Component<SwipeProps, SwipeState> {
focusIndex: this.setRightFocusIndex(focusIndex + 1),
haveAnimate: true
}, () => {
setTimeout(() => {
this.timeoutId = setTimeout(() => {
this.setState({
focusIndex: 1,
haveAnimate: false
Expand All @@ -153,7 +153,7 @@ export default class Swipe extends React.Component<SwipeProps, SwipeState> {
focusIndex: this.setRightFocusIndex(focusIndex + 1),
haveAnimate: true
});
setTimeout(() => {
this.timeoutId = setTimeout(() => {
this.state.swiping = false;
}, this.props.speed);
}
Expand All @@ -171,7 +171,7 @@ export default class Swipe extends React.Component<SwipeProps, SwipeState> {
focusIndex: this.setRightFocusIndex(focusIndex - 1),
haveAnimate: true
}, () => {
setTimeout(() => {
this.timeoutId = setTimeout(() => {
this.setState({
focusIndex: this.getItemsLength() - 2,
haveAnimate: false
Expand All @@ -184,7 +184,7 @@ export default class Swipe extends React.Component<SwipeProps, SwipeState> {
focusIndex: this.setRightFocusIndex(focusIndex - 1),
haveAnimate: true
});
setTimeout(() => {
this.timeoutId = setTimeout(() => {
this.state.swiping = false;
}, this.props.speed);
}
Expand Down

0 comments on commit 39ee3f5

Please sign in to comment.