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