force game to clear on ws loss

This commit is contained in:
Branden J Brown 2024-02-02 19:57:28 -06:00
parent da516b75f4
commit af9b287252
1 changed files with 5 additions and 0 deletions

View File

@ -43,6 +43,11 @@ const { status, data, send, open } = useWebSocket<string>(`wss://${window.locati
interval: 1000, interval: 1000,
message: '{"action":"ping"}', message: '{"action":"ping"}',
}, },
onDisconnected: (ws, evt) => {
console.warn('lost connection', {evt});
game.value = null;
dealer.value = null;
}
}); });
const game = ref<Game | null>(null); const game = ref<Game | null>(null);
const dealer = ref<boolean | null>(null); const dealer = ref<boolean | null>(null);