Stopping client online time updater when client isn't in view anymore

This commit is contained in:
WolverinDEV 2019-11-06 14:34:19 +01:00
parent 27e3967ffa
commit 6b275a16ff

View file

@ -2458,7 +2458,13 @@ test
this._online_time_updater = undefined;
return;
}
online_time.text(format.time.format_online_time(client.calculateOnlineTime()));
if(client.currentChannel()) /* If he has no channel then he might be disconnected */
online_time.text(format.time.format_online_time(client.calculateOnlineTime()));
else {
online_time.text(online_time.text() + tr(" (left view)"));
clearInterval(this._online_time_updater);
}
}, 1000);
}