fix double ready
This commit is contained in:
parent
70f99a6ffd
commit
917b239647
@ -49,11 +49,6 @@ function InstanceCtrlBtns(args) {
|
||||
|
||||
const finished = instance && instance.phase === 'Finished';
|
||||
|
||||
const skip = instance.time_control === 'Practice' && instance.phase === 'Lobby';
|
||||
if (skip) {
|
||||
sendReady();
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="instance-ctrl-btns">
|
||||
<button disabled={!account.subscribed} onClick={() => setChatShow(!chatShow)}>Chat</button>
|
||||
|
||||
@ -210,13 +210,18 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
function setInstance(v) {
|
||||
const { account, instance, ws, tutorial } = store.getState();
|
||||
const { account, ws, tutorial } = store.getState();
|
||||
if (v) {
|
||||
setInvite(null);
|
||||
setPvp(false);
|
||||
const player = v.players.find(p => p.id === account.id);
|
||||
store.dispatch(actions.setPlayer(player));
|
||||
|
||||
const skip = v.time_control === 'Practice' && v.phase === 'Lobby';
|
||||
if (skip) {
|
||||
ws.sendInstanceReady(v.id);
|
||||
}
|
||||
|
||||
if (v.phase === 'Finished') {
|
||||
ws.sendAccountInstances();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user