From 807f834aaad1497d88c188bd4da70a52e2e4d02c Mon Sep 17 00:00:00 2001 From: Jesse McDonald Date: Sun, 15 Mar 2020 02:45:18 -0500 Subject: [PATCH] fix for frequently updating text which hasn't changed --- js/chess.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/chess.js b/js/chess.js index 9bdf029..b5b6544 100644 --- a/js/chess.js +++ b/js/chess.js @@ -996,7 +996,10 @@ $(function (){ } } catch (err) {} } - $('#cb_peers').text('Synchronizing with ' + n_open + (n_open === 1 ? ' peer' : ' peers') + ' (' + n_total + ' total).'); + const newText = 'Synchronizing with ' + n_open + (n_open === 1 ? ' peer' : ' peers') + ' (' + n_total + ' total).'; + if (newText !== $('#cb_peers').text()) { + $('#cb_peers').text(newText); + } }, 1000); window.onpopstate = function(event){