1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-01 12:15:25 +00:00

Stats page should auto push stats when it reconnects to the websocket. Spectate page should auto pull when it reconnects to the websocket.

This commit is contained in:
2026-01-29 17:28:14 -05:00
parent 9c2a9d62ad
commit a2f8c7bced
3 changed files with 72 additions and 6 deletions

View File

@@ -76,6 +76,11 @@ export default class extends Controller {
this.statusIndicatorTarget.classList.remove('alert-danger', 'alert-secondary', 'text-danger', 'text-dark')
this.statusIndicatorTarget.classList.add('alert-success')
}
try {
this.matchSubscription.perform('request_sync')
} catch (e) {
console.error('[Spectator AC] request_sync perform failed:', e)
}
},
disconnected: () => {
console.log(`[Spectator AC Callback] Disconnected: ${matchId}`)
@@ -131,4 +136,4 @@ export default class extends Controller {
this.finishedTarget.textContent = data.finished ? 'Yes' : 'No'
}
}
}
}