tutorial state fixes

This commit is contained in:
Mashy 2020-01-20 11:33:12 +10:00
parent 6cb99576c0
commit f51c28a713
3 changed files with 3 additions and 9 deletions

View File

@ -50,7 +50,7 @@ function InstanceCtrlBtns(args) {
} = args; } = args;
const finished = instance && instance.phase === 'Finished'; const finished = instance && instance.phase === 'Finished';
const tutorialDisable = tutorial && tutorial < 8; const tutorialDisable = instance.time_control === 'Practice' && tutorial;
return ( return (
<div class="instance-ctrl-btns"> <div class="instance-ctrl-btns">
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button> <button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>

View File

@ -180,8 +180,7 @@ function registerEvents(store) {
setPvp(false); setPvp(false);
const player = v.players.find(p => p.id === account.id); const player = v.players.find(p => p.id === account.id);
store.dispatch(actions.setPlayer(player)); store.dispatch(actions.setPlayer(player));
if (tutorial && v.time_control === 'Practice') tutorialVbox(player, store, tutorial);
if (tutorial) tutorialVbox(player, store, tutorial);
if (v.phase === 'Finished') { if (v.phase === 'Finished') {
ws.sendAccountInstances(); ws.sendAccountInstances();
@ -211,10 +210,6 @@ function registerEvents(store) {
return true; return true;
} }
function startTutorial() {
store.dispatch(actions.setTutorial(1));
}
function promptRegister() { function promptRegister() {
store.dispatch(actions.setTutorial(99)); store.dispatch(actions.setTutorial(99));
store.dispatch(actions.setInstance(null)); store.dispatch(actions.setInstance(null));
@ -249,7 +244,6 @@ function registerEvents(store) {
setSubscription, setSubscription,
setWs, setWs,
startTutorial,
promptRegister, promptRegister,
urlHashChange, urlHashChange,

View File

@ -299,7 +299,7 @@ function createSocket(events) {
ChatWheel: wheel => events.setChatWheel(wheel), ChatWheel: wheel => events.setChatWheel(wheel),
// Joining: () => events.notify('Searching for instance...'), // Joining: () => events.notify('Searching for instance...'),
StartTutorial: () => events.startTutorial(), // StartTutorial: () => events.startTutorial(),
PromptRegister: () => events.promptRegister(), PromptRegister: () => events.promptRegister(),
Processing: () => true, Processing: () => true,