timing sync fixes, block timer during animation, remove timeout for POST_ONLY
This commit is contained in:
@@ -10,11 +10,13 @@ const GameCtrlTopButtons = require('./game.ctrl.btns.top');
|
||||
const addState = connect(
|
||||
function receiveState(state) {
|
||||
const {
|
||||
animating,
|
||||
game,
|
||||
account,
|
||||
} = state;
|
||||
|
||||
return {
|
||||
animating,
|
||||
game,
|
||||
account,
|
||||
};
|
||||
@@ -23,6 +25,7 @@ const addState = connect(
|
||||
|
||||
function Controls(args) {
|
||||
const {
|
||||
animating,
|
||||
account,
|
||||
game,
|
||||
} = args;
|
||||
@@ -31,10 +34,10 @@ function Controls(args) {
|
||||
|
||||
const opponent = game.players.find(t => t.id !== account.id);
|
||||
const player = game.players.find(t => t.id === account.id);
|
||||
|
||||
const zero = Date.parse(game.phase_start);
|
||||
const now = Date.now();
|
||||
const now = animating ? zero : Date.now();
|
||||
const end = Date.parse(game.phase_end);
|
||||
|
||||
const timerPct = game.phase_end
|
||||
? ((now - zero) / (end - zero) * 100)
|
||||
: 100;
|
||||
|
||||
Reference in New Issue
Block a user