registered accounts tutorial with localstorage, disable instance ready until finish tutorial
This commit is contained in:
parent
e91cf4d987
commit
8e728b77e0
@ -10,6 +10,7 @@ const addState = connect(
|
||||
chatShow,
|
||||
instance,
|
||||
account,
|
||||
tutorial,
|
||||
} = state;
|
||||
|
||||
function sendReady() {
|
||||
@ -21,6 +22,7 @@ const addState = connect(
|
||||
instance,
|
||||
chatShow,
|
||||
account,
|
||||
tutorial,
|
||||
|
||||
sendReady,
|
||||
};
|
||||
@ -42,17 +44,17 @@ function InstanceCtrlBtns(args) {
|
||||
instance,
|
||||
chatShow,
|
||||
account,
|
||||
|
||||
tutorial,
|
||||
sendReady,
|
||||
setChatShow,
|
||||
} = args;
|
||||
|
||||
const finished = instance && instance.phase === 'Finished';
|
||||
|
||||
const tutorialDisable = tutorial && tutorial < 8;
|
||||
return (
|
||||
<div class="instance-ctrl-btns">
|
||||
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
|
||||
<button disabled={finished} class="ready" onClick={() => sendReady()}>Ready</button>
|
||||
<button disabled={finished || tutorialDisable} class="ready" onClick={() => sendReady()}>Ready</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -116,7 +116,6 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
store.dispatch(actions.setAccount(account));
|
||||
store.dispatch(actions.setTutorial(null));
|
||||
store.dispatch(actions.setAuthenticated(true));
|
||||
}
|
||||
|
||||
@ -189,7 +188,6 @@ function registerEvents(store) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return store.dispatch(actions.setInstance(v));
|
||||
}
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ module.exports = {
|
||||
teamPage: createReducer(0, 'SET_TEAM_PAGE'),
|
||||
teamSelect: createReducer([null, null, null], 'SET_TEAM_SELECT'),
|
||||
|
||||
tutorial: createReducer(1, 'SET_TUTORIAL'),
|
||||
tutorial: createReducer(localStorage.getItem('tutorial-complete') ? null : 1, 'SET_TUTORIAL'),
|
||||
|
||||
vboxSelected: createReducer({ storeSelect: [], stashSelect: [] }, 'SET_VBOX_SELECTED'),
|
||||
vboxCombiner: createReducer(null, 'SET_VBOX_COMBINER'),
|
||||
|
||||
@ -197,10 +197,10 @@ function tutorialStage(tutorial, clearTutorial, instance) {
|
||||
}
|
||||
|
||||
if (tutorial === 8) {
|
||||
localStorage.setItem('tutorial-complete', true);
|
||||
if (window.innerWidth < 1000) {
|
||||
return exit();
|
||||
}
|
||||
|
||||
return (
|
||||
<div class='info-item'>
|
||||
<h2>GLHF</h2>
|
||||
@ -210,6 +210,7 @@ function tutorialStage(tutorial, clearTutorial, instance) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user