[feature] now resetting everything on reconnect

This commit is contained in:
Janis
2022-10-25 19:33:36 +02:00
parent d599e5d8ab
commit e7313a2958
3 changed files with 31 additions and 8 deletions

View File

@@ -50,4 +50,19 @@ class List {
clear() {
this.items = [];
}
setItems(items) {
// Never tested
let duplicateFound = false;
items.forEach((e1, i) => {
items.forEach((e2, j) => {
if (e1.id === e2.id && i != j) {
duplicateFound = true;
}
});
});
if (!duplicateFound) {
this.items = items;
}
}
}