confirm to leave page

This commit is contained in:
Mawoka
2022-04-11 22:38:53 +02:00
parent c44148db92
commit 0636cb6e2f
4 changed files with 28 additions and 0 deletions
+6
View File
@@ -56,6 +56,11 @@
unique = {};
}
const confirmUnload = () => {
event.preventDefault();
event.returnValue = '';
};
// Socket-events
socket.on('joined_game', (data) => {
console.log('joined_game', data);
@@ -89,6 +94,7 @@
// The rest
</script>
<svelte:window on:beforeunload={confirmUnload} />
<svelte:head>
<title>ClassQuiz - Play</title>
{#if gameData !== undefined}