diff client.js @ 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 e47b9bd55192
children 8724e28ccbd7
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);
         }
     }
 });