Skip to content

Commit

Permalink
fix(android): don't crash when navigating back during gallery mounting
Browse files Browse the repository at this point in the history
Immediate close fix
  • Loading branch information
Exilz authored Dec 12, 2017
2 parents 606a968 + 6e494f9 commit d8944cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libraries/ViewPager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ export default class ViewPager extends PureComponent {
if (immediate) {
InteractionManager.runAfterInteractions(() => {
this.scroller.startScroll(this.scroller.getCurrX(), 0, finalX - this.scroller.getCurrX(), 0, 0);
this.refs['innerFlatList'].scrollToOffset({offset: finalX, animated: false});
this.refs['innerFlatList'].recordInteraction();
this.refs['innerFlatList'] && this.refs['innerFlatList'].scrollToOffset({offset: finalX, animated: false});
this.refs['innerFlatList'] && this.refs['innerFlatList'].recordInteraction();
});
} else {
this.scroller.startScroll(this.scroller.getCurrX(), 0, finalX - this.scroller.getCurrX(), 0, 400);
Expand Down

0 comments on commit d8944cc

Please sign in to comment.