Skip to content

Commit

Permalink
Merge pull request #85 from STOP2/backbutton_fix2
Browse files Browse the repository at this point in the history
moved to willreceiveprops
  • Loading branch information
avrj authored Nov 26, 2016
2 parents d1bae8a + adf5a6d commit a72c1cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/pages/StopRequestPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class StopRequestPage extends Component{
this.setState({fetchIntervalRunning: true})
this.setState({minutesLeft: this.props.vehicle.arrival + ' ' + strings.minutes})
this.createInterval(this.props)
BackAndroid.addEventListener('hardwareBackPress', this.backAndroidHandler)
}

componentWillReceiveProps = (nextProps) =>
Expand All @@ -62,6 +61,7 @@ class StopRequestPage extends Component{

if (nextProps.scene.name == this.sceneName)
{
BackAndroid.addEventListener('hardwareBackPress', this.backAndroidHandler)
if (!this.state.fetchIntervalRunning)
{
this.setState({fetchIntervalRunning: true})
Expand Down

0 comments on commit a72c1cb

Please sign in to comment.