diff --git a/client/src/components/game.ctrl.btns.top.jsx b/client/src/components/game.ctrl.btns.top.jsx index 4ab0d543..2e54b54b 100644 --- a/client/src/components/game.ctrl.btns.top.jsx +++ b/client/src/components/game.ctrl.btns.top.jsx @@ -8,6 +8,7 @@ const addState = connect( const { ws, game, + animating, } = state; function sendAbandon() { @@ -16,30 +17,31 @@ const addState = connect( return { game, - sendAbandon, + animating, }; }, + function receiveDispatch(dispatch) { function leave() { dispatch(actions.setNav('play')); dispatch(actions.setGame(null)); - dispatch(actions.setInstance(null)); } return { leave }; } + ); function GameCtrlTopBtns(args) { const { game, - leave, sendAbandon, + animating, } = args; - const finished = game && game.phase === 'Finished'; + const finished = game && game.phase === 'Finish'; const { abandonState } = this.state; const abandonStateTrue = e => { @@ -52,7 +54,7 @@ function GameCtrlTopBtns(args) { const abandonText = abandonState ? 'Confirm' : 'Abandon'; const abandonAction = abandonState ? sendAbandon : abandonStateTrue; - const abandonBtn = ; + const abandonBtn = ; const leaveBtn = ; return ( diff --git a/client/src/components/instance.ctrl.top.btns.jsx b/client/src/components/instance.ctrl.top.btns.jsx index 528e5d0e..3f01aea8 100644 --- a/client/src/components/instance.ctrl.top.btns.jsx +++ b/client/src/components/instance.ctrl.top.btns.jsx @@ -8,6 +8,7 @@ const addState = connect( const { ws, instance, + tutorial, } = state; function sendAbandon() { @@ -21,10 +22,11 @@ const addState = connect( }; }, function receiveDispatch(dispatch) { - function leave() { + function leave(tutorial) { dispatch(actions.setNav('play')); dispatch(actions.setGame(null)); dispatch(actions.setInstance(null)); + if (tutorial && tutorial < 7) dispatch(actions.setTutorial(1)); } return { leave }; @@ -37,6 +39,7 @@ function InstanceTopBtns(args) { leave, sendAbandon, + tutorial, } = args; const finished = instance && instance.phase === 'Finished'; @@ -53,7 +56,7 @@ function InstanceTopBtns(args) { const abandonAction = abandonState ? sendAbandon : abandonStateTrue; const abandonBtn = ; - const leaveBtn = ; + const leaveBtn = ; return (