another fix for human choices
This commit is contained in:
@@ -197,19 +197,8 @@ function wireSSE() {
|
||||
})
|
||||
scrollLiveLog()
|
||||
},
|
||||
async onHumanChallenge(sseData) {
|
||||
if (myBot.value) {
|
||||
try {
|
||||
const res = await fetch(`/api/fights/${fightId.value}/challenge/${myBot.value.id}`)
|
||||
if (res.ok) {
|
||||
const fullData = await res.json()
|
||||
if (fullData.pending) {
|
||||
handleSSEChallenge(fullData)
|
||||
return
|
||||
}
|
||||
}
|
||||
} catch { /* fall through */ }
|
||||
}
|
||||
onHumanChallenge(sseData) {
|
||||
// SSE now includes choices directly — no secondary fetch needed
|
||||
handleSSEChallenge(sseData)
|
||||
},
|
||||
onRoundEnd(data) {
|
||||
@@ -539,6 +528,9 @@ async function fightAgain(botId: string) {
|
||||
liveHpA.value = 100
|
||||
liveHpB.value = 100
|
||||
liveCurrentRound.value = 0
|
||||
// Stop ALL old polling/connections before starting new fight
|
||||
stopHumanPolling()
|
||||
stopPolling()
|
||||
disconnectSSE()
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user