Fix question motion on correct answer

This commit is contained in:
Berkeley Martinez
2015-12-30 15:49:44 -08:00
parent 92246c2dd8
commit a39746d381

View File

@ -167,17 +167,28 @@ export default Actions({
// index 0 // index 0
if (tests[currentQuestion]) { if (tests[currentQuestion]) {
return { return Observable.just({
transform(state) {
const hikesApp = {
...state.hikesApp,
mouse: [0, 0]
};
return { ...state, hikesApp };
}
})
.delay(300)
.startWith({
transform(state) { transform(state) {
const hikesApp = { const hikesApp = {
...state.hikesApp, ...state.hikesApp,
currentQuestion: currentQuestion + 1 currentQuestion: currentQuestion + 1,
mouse: [ userAnswer ? 1000 : -1000, 0]
}; };
return { ...state, hikesApp }; return { ...state, hikesApp };
} }
}; });
} }
// challenge completed // challenge completed
@ -220,7 +231,7 @@ export default Actions({
}, },
optimistic: optimisticSave optimistic: optimisticSave
}) })
.delay(500) .delay(300)
.startWith(correctAnswer) .startWith(correctAnswer)
.catch(err => { .catch(err => {
console.error(err); console.error(err);