human fight sequence fix
This commit is contained in:
@@ -65,6 +65,7 @@ export function useFightPolling(fightId: Ref<string>) {
|
||||
function startPolling(callbacks?: {
|
||||
onFinished?: () => void
|
||||
onTimeout?: () => void
|
||||
keepLive?: boolean // Don't set isLive=false (human fights manage lifecycle via SSE)
|
||||
}) {
|
||||
pollCount = 0
|
||||
pollHandle = setInterval(async () => {
|
||||
@@ -72,7 +73,7 @@ export function useFightPolling(fightId: Ref<string>) {
|
||||
const s = await loadFight()
|
||||
if (s === 'finished') {
|
||||
if (!eventSource) {
|
||||
isLive.value = false
|
||||
if (!callbacks?.keepLive) isLive.value = false
|
||||
disconnectSSE()
|
||||
stopPolling()
|
||||
callbacks?.onFinished?.()
|
||||
|
||||
Reference in New Issue
Block a user