From 59e8c916390a3eb215c8b4be49a919bb3319b014 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 27 Feb 2021 16:13:37 +0300 Subject: remove obsolete user panels --- index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'index.html') diff --git a/index.html b/index.html index 1650330..8c46b82 100644 --- a/index.html +++ b/index.html @@ -107,7 +107,7 @@ function add_user(name) { return; } let text = ` -
+

${name}


@@ -147,6 +147,15 @@ function set_user(name, data) { } function set_users(data) { + users.forEach(function(name) { + if (!(name in data)) { + $('#user_' + name).remove(); + let i = users.indexOf(name); + if (i > -1) { + users.splice(i, 1); + } + } + }); Object.keys(data).forEach(function(name) { set_user(name, data[name]); }); -- cgit v1.2.3