From a92df384791a97fac564a6d8f8c4668613aca02c Mon Sep 17 00:00:00 2001 From: azivner Date: Sun, 26 Nov 2017 17:04:18 -0500 Subject: [PATCH] tweaks to time values --- public/javascripts/init.js | 8 ++++---- public/javascripts/utils.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/javascripts/init.js b/public/javascripts/init.js index 20bedeff8..60d3b0ee0 100644 --- a/public/javascripts/init.js +++ b/public/javascripts/init.js @@ -176,7 +176,7 @@ function connectWebSocket() { ws.onmessage = messageHandler; ws.onclose = function(){ // Try to reconnect in 5 seconds - setTimeout(() => connectWebSocket(), 1000); + setTimeout(() => connectWebSocket(), 5000); }; } @@ -185,7 +185,7 @@ connectWebSocket(); let lastPingTs = new Date().getTime(); let connectionBrokenNotification = null; -setInterval(() => { +setInterval(async () => { if (new Date().getTime() - lastPingTs > 5000) { if (!connectionBrokenNotification) { connectionBrokenNotification = $.notify({ @@ -194,12 +194,12 @@ setInterval(() => { },{ // settings type: 'danger', - delay: 100000000 + delay: 100000000 // keep it until we explicitly close it }); } } else if (connectionBrokenNotification) { - connectionBrokenNotification.close(); + await connectionBrokenNotification.close(); connectionBrokenNotification = null; showMessage("Re-connected to server"); diff --git a/public/javascripts/utils.js b/public/javascripts/utils.js index 84a5235f3..72e2c661e 100644 --- a/public/javascripts/utils.js +++ b/public/javascripts/utils.js @@ -9,7 +9,7 @@ function showMessage(message) { },{ // settings type: 'success', - delay: 1500 + delay: 3000 }); }