Skip to content

Commit

Permalink
fix bids after a failed one not showing up in matches
Browse files Browse the repository at this point in the history
announce failed bids
  • Loading branch information
merklejerk committed Jun 19, 2024
1 parent c9f0f85 commit 4dbb526
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/routes/(app)/match/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@
const log = logs[i];
if (log.event === 'block_bid') {
bids[log.builderIdx] = Number(log.bid) / 1e18;
} else if (log.event === 'build_block_failed') {
bids[log.builderIdx] = NaN;
} else {
break;
}
Expand Down Expand Up @@ -650,14 +652,21 @@
<span class:builder={playerIdx === round.block?.builderIdx}>
{#if roundIdx === data.rounds.length - 1 && playerIdx === data.winnerIdx}🏆️{/if}
<Player name={data.players[playerIdx].name} />
{#if round.block?.bids && round.block.bids[playerIdx] > 0}
{#if round.block?.bids}
{#if round.block.bids[playerIdx] > 0}
<span class="bid">
bid
<span class="asset">{getAssetEmoji(0)}</span>
<span class="quantity">{formatAmount(round.block.bids[playerIdx])}</span>
and
</span>
{/if}
and
{:else if isNaN(round.block.bids[playerIdx])}
<span class="failed-bid">
FAILED their bid
</span>
and
{/if}
{/if}
holds:
</span>
{#each round.balances[playerIdx] as bal, assetIdx}
Expand Down

0 comments on commit 4dbb526

Please sign in to comment.