only send socket lag when logged in

pull/4785/head
Thibault Duplessis 2018-12-14 11:48:08 +08:00
parent aa8e076647
commit ac1dd0c604
2 changed files with 3 additions and 2 deletions

View File

@ -121,7 +121,8 @@ lichess.topMenuIntent = function() {
params: {},
options: {
name: "site",
lagTag: null
lagTag: null,
isAuth: !!$('body').data('user')
}
});

View File

@ -140,7 +140,7 @@ lichess.StrongSocket = function(url, version, settings) {
};
var pingData = function(forceVersion) {
var sendLag = pongCount % 8 === 2;
var sendLag = options.isAuth && pongCount % 8 === 2;
if (!versioned || !(forceVersion || sendLag)) return null;
var data = {
t: "p"