navto fetches instance list
This commit is contained in:
parent
cb49552927
commit
18f580f9aa
@ -23,6 +23,10 @@ const addState = connect(
|
||||
return ws.sendInstanceState(instance.id);
|
||||
}
|
||||
|
||||
function sendAccountInstances() {
|
||||
return ws.sendAccountInstances();
|
||||
}
|
||||
|
||||
return {
|
||||
account,
|
||||
instances,
|
||||
@ -30,6 +34,7 @@ const addState = connect(
|
||||
constructs,
|
||||
game,
|
||||
sendInstanceState,
|
||||
sendAccountInstances,
|
||||
};
|
||||
},
|
||||
function receiveDispatch(dispatch) {
|
||||
@ -41,7 +46,7 @@ const addState = connect(
|
||||
return dispatch(actions.setInstance(testInstance(id)));
|
||||
}
|
||||
|
||||
function navTo(place) {
|
||||
function setNav(place) {
|
||||
dispatch(actions.setGame(null));
|
||||
dispatch(actions.setInstance(null));
|
||||
return dispatch(actions.setNav(place));
|
||||
@ -50,7 +55,7 @@ const addState = connect(
|
||||
return {
|
||||
setTestGame,
|
||||
setTestInstance,
|
||||
navTo,
|
||||
setNav,
|
||||
};
|
||||
}
|
||||
);
|
||||
@ -59,16 +64,23 @@ function Nav(args) {
|
||||
const {
|
||||
account,
|
||||
sendInstanceState,
|
||||
sendAccountInstances,
|
||||
|
||||
team,
|
||||
constructs,
|
||||
instances,
|
||||
game,
|
||||
|
||||
navTo,
|
||||
setTestGame,
|
||||
setTestInstance,
|
||||
setNav,
|
||||
} = args;
|
||||
|
||||
function navTo(p) {
|
||||
if (p === 'list') sendAccountInstances();
|
||||
return setNav(p);
|
||||
}
|
||||
|
||||
function joinInstance(i) {
|
||||
if (game) navTo(null);
|
||||
sendInstanceState(i);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user