changeset 12:139b223dafb0

Actually remove all of the extra data on disconnect.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 22 Dec 2018 16:27:49 +0100
parents aedf80eefc19
children 8724e28ccbd7
files client.js
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client.js
+++ b/client.js
@@ -107,11 +107,14 @@ document.addEventListener('DOMContentLoa
         jid_element.disabled = false;
         pass_element.disabled = false;
         spinner_img.hidden = true;
-        for (let item of document.getElementById('roster-table')) {
-            item.remove();
+        connected_div.hidden = true;
+        let table = document.getElementById('roster-table');
+        while (table.hasChildNodes()) {
+            table.removeChild(table.lastChild);
         }
-        for (let item of document.getElementById('pep-table')) {
-            item.remove();
+        table = document.getElementById('pep-table');
+        while (table.hasChildNodes()) {
+            table.removeChild(table.lastChild);
         }
     }
 });