demo state check

This commit is contained in:
ntr 2019-09-19 22:33:07 +10:00
parent d6d0800566
commit 2217afaa64

View File

@ -206,6 +206,7 @@ function registerEvents(store) {
} }
function setDemo(d) { function setDemo(d) {
const initial = { const initial = {
players: d, players: d,
combiner: [], combiner: [],
@ -215,7 +216,8 @@ function registerEvents(store) {
}; };
const startDemo = () => { const startDemo = () => {
console.log(initial); const { account } = store.getState();
if (account) return false;
store.dispatch(actions.setDemo(initial)); store.dispatch(actions.setDemo(initial));
store.dispatch(actions.setAnimTarget(null)); store.dispatch(actions.setAnimTarget(null));
setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0] }))), 2000); setTimeout(() => store.dispatch(actions.setDemo(Object.assign({}, initial, { combiner: [0] }))), 2000);