client: only clear the screen on first load, not on refresh

This commit is contained in:
mappu 2017-02-05 17:09:18 +13:00
parent b26b3a695e
commit 1eaabb099d

View File

@ -667,6 +667,8 @@ var last_tab = "tab-main";
var show_joins = false;
var have_cleared_once = false;
/* */
var persistence_set = function(key, value) {
@ -752,9 +754,13 @@ window.onload = function() {
sock = io.connect(DCWEBUI_CONF.extern);
sock.on('cls', function() {
write("tab-main").cls();
userlist.clear();
hub_state = 0;
if (!have_cleared_once) {
write("tab-main").cls();
userlist.clear();
have_cleared_once = true; // don't re-clear, keep history
}
});
sock.on('hubname', function(s) {
write("tab-main").system("Now talking on "+s);