From 1eaabb099d7ed2dd64d12c04509b054032ad2a85 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 5 Feb 2017 17:09:18 +1300 Subject: [PATCH] client: only clear the screen on first load, not on refresh --- client/dcwebui.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/dcwebui.js b/client/dcwebui.js index 9539402..e7cf98e 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -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);