From 38177f84e9670f50929b1136c0f2f8f882c3f481 Mon Sep 17 00:00:00 2001 From: ntr Date: Thu, 31 Oct 2019 16:59:26 +1100 Subject: [PATCH] disable tutorial via localstorage" --- client/src/tutorial.utils.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/tutorial.utils.jsx b/client/src/tutorial.utils.jsx index 7f6bb854..3732d11a 100644 --- a/client/src/tutorial.utils.jsx +++ b/client/src/tutorial.utils.jsx @@ -2,6 +2,7 @@ const preact = require('preact'); const actions = require('./actions'); function tutorialConstructDisplay(player, instance, tutorial, navInstance, i) { + if (localStorage.getItem('tutorial-complete')) return false; if (instance.time_control === 'Practice' && instance.rounds.length === 1 && tutorial && tutorial < 6) { if (tutorial <= 2 || (tutorial > 2 && i > 0)) { const mobileVisible = navInstance === i + 1; @@ -13,12 +14,14 @@ function tutorialConstructDisplay(player, instance, tutorial, navInstance, i) { } function tutorialShouldDisableEquip(tutorial, iter, instance, construct) { + if (localStorage.getItem('tutorial-complete')) return false; return tutorial && tutorial === 6 && iter === 0 && construct.skills.length !== 0 && instance.time_control === 'Practice' && instance.rounds.length === 1; } function tutorialVbox(player, store, tutorial) { + if (localStorage.getItem('tutorial-complete')) return false; let stage = tutorial; const { vbox } = player; if (stage === 1) { @@ -99,11 +102,15 @@ function tutorialVbox(player, store, tutorial) { } function tutorialStage(tutorial, ws, clearTutorial, instance) { + if (localStorage.getItem('tutorial-complete')) return false; if (!(instance.time_control === 'Practice' && instance.rounds.length === 1)) return false; + const exit = () => { clearTutorial(); + localStorage.setItem('tutorial-complete', true); ws.sendInstanceState(instance.id); }; + const tutorialText = () => { if (tutorial === 1) { return (