document.addEventListener('htmx:wsAfterMessage', function (e) {
const message = JSON.parse(e.detail.message);
if (message.type === 'redirect_to_game') {
window.location.href = '/?gameId=' + message.gameId;
}
});