human fight non multiple choice fix
This commit is contained in:
@@ -113,6 +113,9 @@ export function useHumanChallenge(
|
||||
}
|
||||
if (!humanChallenge.value || humanChallenge.value.roundNumber !== data.roundNumber) {
|
||||
applyChallenge(data)
|
||||
} else if (data.choices?.length && humanChoices.value.length === 0) {
|
||||
// SSE fallback had no choices, polling found them — update
|
||||
humanChoices.value = data.choices
|
||||
}
|
||||
} else if (data.fightStatus === 'finished') {
|
||||
humanChallenge.value = null
|
||||
|
||||
@@ -553,7 +553,6 @@ async function fightAgain(botId: string) {
|
||||
window.history.replaceState({}, '', `/arena/${data.fightId}`)
|
||||
startPolling({ onFinished: () => stopHumanPolling(), onTimeout: () => stopHumanPolling() })
|
||||
if (isHumanFight.value) {
|
||||
startHumanPolling()
|
||||
wireSSE()
|
||||
for (let i = 0; i < 20; i++) {
|
||||
await loadFight()
|
||||
@@ -563,6 +562,7 @@ async function fightAgain(botId: string) {
|
||||
await nextTick()
|
||||
await nextTick()
|
||||
if (liveFightData.value) await initLiveScene()
|
||||
startHumanPolling()
|
||||
}
|
||||
} else {
|
||||
fightError.value = `Failed to start fight (${res.status})`
|
||||
|
||||
Reference in New Issue
Block a user