Fix hike transition bug
This commit is contained in:
@ -48,6 +48,7 @@ export default Store({
|
||||
toggleQuestions,
|
||||
fetchHikes,
|
||||
hideInfo,
|
||||
resetHike,
|
||||
grabQuestion,
|
||||
releaseQuestion,
|
||||
moveQuestion,
|
||||
@ -59,6 +60,7 @@ export default Store({
|
||||
toggleQuestions,
|
||||
fetchHikes,
|
||||
hideInfo,
|
||||
resetHike,
|
||||
grabQuestion,
|
||||
releaseQuestion,
|
||||
moveQuestion,
|
||||
|
@ -23,12 +23,13 @@ export default contain(
|
||||
showQuestions: PropTypes.bool
|
||||
},
|
||||
|
||||
componentWillReceiveProps({ params: { dashedName }, showQuestions }) {
|
||||
if (
|
||||
showQuestions &&
|
||||
this.props.params.dashedName !== dashedName
|
||||
) {
|
||||
this.props.hikesActions.toggleQuestions();
|
||||
componentWillUnmount() {
|
||||
this.props.hikesActions.resetHike();
|
||||
},
|
||||
|
||||
componentWillReceiveProps({ params: { dashedName } }) {
|
||||
if (this.props.params.dashedName !== dashedName) {
|
||||
this.props.hikesActions.resetHike();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -175,7 +175,8 @@ export default Actions({
|
||||
transform(state) {
|
||||
const hikesApp = {
|
||||
...state.hikesApp,
|
||||
mouse: [0, 0]
|
||||
mouse: [0, 0],
|
||||
showInfo: false
|
||||
};
|
||||
return { ...state, hikesApp };
|
||||
}
|
||||
@ -250,5 +251,21 @@ export default Actions({
|
||||
.catch(err => Observable.just({
|
||||
transform(state) { return { ...state, err }; }
|
||||
}));
|
||||
},
|
||||
resetHike() {
|
||||
return {
|
||||
transform(state) {
|
||||
return { ...state,
|
||||
hikesApp: {
|
||||
...state.hikesApp,
|
||||
currentQuestion: 1,
|
||||
showQuestions: false,
|
||||
showInfo: false,
|
||||
mouse: [0, 0],
|
||||
delta: [0, 0]
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user