From a39746d381bfe629b3e44a7de9fd90011018c36d Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Wed, 30 Dec 2015 15:49:44 -0800 Subject: [PATCH] Fix question motion on correct answer --- common/app/routes/Hikes/flux/Actions.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/common/app/routes/Hikes/flux/Actions.js b/common/app/routes/Hikes/flux/Actions.js index 18c8c9cd6b..a76a98961a 100644 --- a/common/app/routes/Hikes/flux/Actions.js +++ b/common/app/routes/Hikes/flux/Actions.js @@ -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);