Fix websocket connection indicator
This commit is contained in:
parent
742bd4f106
commit
10c0f38df0
|
@ -30,6 +30,14 @@ gameLinkInput.value =
|
|||
// Update the WebSocket status indicator
|
||||
const wsStatusDiv = document.getElementById('ws-status');
|
||||
|
||||
gameContainer.addEventListener('htmx:wsConnecting', function () {
|
||||
if (wsStatusDiv) wsStatusDiv.textContent = 'Connecting...';
|
||||
});
|
||||
|
||||
gameContainer.addEventListener('htmx:wsOpen', function () {
|
||||
if (wsStatusDiv) wsStatusDiv.textContent = 'Connected';
|
||||
});
|
||||
|
||||
gameContainer.addEventListener('htmx:wsClose', function () {
|
||||
if (wsStatusDiv) wsStatusDiv.textContent = 'Disconnected';
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue