aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--index.html11
1 files changed, 10 insertions, 1 deletions
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 = `
-<div class="row">
+<div class="row" id="user_${name}">
<div class="col">
<h2>${name}</h2>
<hr>
@@ -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]);
});