Fix question motion on correct answer

pull/6034/head
Berkeley Martinez 2015-12-30 15:49:44 -08:00
parent bcd6a56de6
commit 38d2513223
1 changed files with 17 additions and 6 deletions

View File

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