Delete empty unsubmitted submissions when delete is called

This commit is contained in:
Ajay Ramachandran 2020-07-04 15:34:29 -04:00
parent c69047c7f9
commit 684cd676e5

View file

@ -109,7 +109,15 @@ class SBMap<T, U> extends Map {
delete(key) {
const result = super.delete(key);
this.update();
// Make sure there are no empty elements
for (const entry of this.entries()) {
if (entry[1].length === 0) {
super.delete(entry[0]);
}
}
this.update();
return result;
}