From: Raphaƫl Jakse Date: Tue, 14 Apr 2020 22:43:41 +0000 (+0200) Subject: Avoid restarting the connection when leaving the game X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=4aeb1c709e4612baf84ebd89e2bbf3dcfe38758a;p=trivabble.git Avoid restarting the connection when leaving the game --- diff --git a/trivabble.js b/trivabble.js index caa1562..3a48441 100644 --- a/trivabble.js +++ b/trivabble.js @@ -1425,6 +1425,8 @@ window.addEventListener("DOMContentLoaded", initLang); + window.addEventListener("beforeunload", stopConnection); + window.addEventListener("offline", function () { stopConnection(); showConnectionLost(_("It seems your browser went offline. Please reconnect to continue playing."));