score in nav
This commit is contained in:
parent
6bf5b684ca
commit
ed4de4a54a
@ -6,7 +6,7 @@ const addState = connect(
|
||||
function receiveState(state) {
|
||||
const { ws, team, account } = state;
|
||||
|
||||
function sendInstanceNew(sConstructs, pve) {
|
||||
function sendInstanceNew(sConstructs, name, pve) {
|
||||
if (sConstructs.length) {
|
||||
return ws.sendInstanceNew(sConstructs, account.name, pve);
|
||||
}
|
||||
|
||||
@ -118,9 +118,13 @@ function Nav(args) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const joined = instances.map(i => (
|
||||
<button key={i.id} onClick={() => joinInstance(i)} >{i.name}</button>
|
||||
));
|
||||
const joined = instances.map(i => {
|
||||
const score = i.players.find(p => p.id === account.id);
|
||||
const phase = i.rounds[i.rounds.length - 1].game_id
|
||||
? 'In game'
|
||||
: 'Vbox';
|
||||
return <button key={i.id} onClick={() => joinInstance(i)} >{`${phase} ${score.wins} / ${score.losses}`}</button>
|
||||
});
|
||||
|
||||
const haxSection = process.env.NODE_ENV === 'development'
|
||||
? (
|
||||
|
||||
@ -156,6 +156,7 @@ function createSocket(events) {
|
||||
function accountInstanceList(res) {
|
||||
const [struct, playerList] = res;
|
||||
events.setAccountInstances(playerList);
|
||||
setTimeout(sendAccountInstances, 5000);
|
||||
}
|
||||
|
||||
function accountConstructs(response) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user