diff --git a/app/static/app.js b/app/static/app.js index de2ee3a..ea8787a 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -488,11 +488,21 @@ async function refreshRound() { // myUserId may not be loaded yet on the very first tick after a reload // (refreshMe() and refreshRound() run concurrently) — fall back to the // persisted result rather than risk showing nothing or the wrong side. + // winner_user_id is committed as soon as the draw picks a winner, but + // winner_amount_sats isn't set until the payout tx is built afterwards + // (a real Electrum round-trip later) — revealing a win before then would + // show "+— PLM". Only the winner's own reveal needs to wait for it. + const iWon = myUserId != null && data.winner_user_id === myUserId; + const amountReady = !iWon || data.winner_amount_sats != null; const canReveal = - data.user_played && data.winner_user_id != null && (alreadyKnown || elapsedMs >= minMs) && myUserId != null; + data.user_played && + data.winner_user_id != null && + (alreadyKnown || elapsedMs >= minMs) && + myUserId != null && + amountReady; if (canReveal) { - const won = data.winner_user_id === myUserId; + const won = iWon; if (!alreadyKnown) { persistResult(data.round_id, won, data.winner_amount_sats); if (won) {