Skip to content

Commit f202a93

Browse files
committed
Keep next-round duel UI ahead of chain round rollback
1 parent 002826e commit f202a93

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

app/js/ui/screens/duel.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,18 @@ var DuelScreen = (function() {
797797
if (!duel) return;
798798

799799
duelState.totalRounds = duel.rounds || duelState.totalRounds;
800-
duelState.currentRound = duel.currentRound || duelState.currentRound;
800+
801+
// Keep on-chain round as source of truth, but do not immediately roll
802+
// the UI back when the player has already advanced from a resolved round
803+
// into the next local seal step.
804+
var chainRound = duel.currentRound || duelState.currentRound;
805+
var localAdvancedRound =
806+
duelState.phase === 'seal' &&
807+
duelState.currentRound > chainRound &&
808+
duel.roundResults &&
809+
duel.roundResults.length === chainRound;
810+
811+
duelState.currentRound = localAdvancedRound ? duelState.currentRound : chainRound;
801812

802813
var user = VizAccount.getCurrentUser();
803814
duelState.opponent = _resolveOpponentFromDuel(duel, user, duelState.opponent);

0 commit comments

Comments
 (0)