From f51c28a7133ddaafe012f328c7f48c4cdd61dbbb Mon Sep 17 00:00:00 2001 From: Mashy Date: Mon, 20 Jan 2020 11:33:12 +1000 Subject: [PATCH] tutorial state fixes --- client/src/components/instance.ctrl.btns.jsx | 2 +- client/src/events.jsx | 8 +------- client/src/socket.jsx | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/client/src/components/instance.ctrl.btns.jsx b/client/src/components/instance.ctrl.btns.jsx index 136987c2..b9b959f7 100644 --- a/client/src/components/instance.ctrl.btns.jsx +++ b/client/src/components/instance.ctrl.btns.jsx @@ -50,7 +50,7 @@ function InstanceCtrlBtns(args) { } = args; const finished = instance && instance.phase === 'Finished'; - const tutorialDisable = tutorial && tutorial < 8; + const tutorialDisable = instance.time_control === 'Practice' && tutorial; return (
diff --git a/client/src/events.jsx b/client/src/events.jsx index ce566608..8f373897 100644 --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -180,8 +180,7 @@ function registerEvents(store) { setPvp(false); const player = v.players.find(p => p.id === account.id); store.dispatch(actions.setPlayer(player)); - - if (tutorial) tutorialVbox(player, store, tutorial); + if (tutorial && v.time_control === 'Practice') tutorialVbox(player, store, tutorial); if (v.phase === 'Finished') { ws.sendAccountInstances(); @@ -211,10 +210,6 @@ function registerEvents(store) { return true; } - function startTutorial() { - store.dispatch(actions.setTutorial(1)); - } - function promptRegister() { store.dispatch(actions.setTutorial(99)); store.dispatch(actions.setInstance(null)); @@ -249,7 +244,6 @@ function registerEvents(store) { setSubscription, setWs, - startTutorial, promptRegister, urlHashChange, diff --git a/client/src/socket.jsx b/client/src/socket.jsx index f72541b2..380625c0 100644 --- a/client/src/socket.jsx +++ b/client/src/socket.jsx @@ -299,7 +299,7 @@ function createSocket(events) { ChatWheel: wheel => events.setChatWheel(wheel), // Joining: () => events.notify('Searching for instance...'), - StartTutorial: () => events.startTutorial(), + // StartTutorial: () => events.startTutorial(), PromptRegister: () => events.promptRegister(), Processing: () => true,