mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-10 09:07:45 +01:00
Delete empty unsubmitted submissions when delete is called
This commit is contained in:
parent
c69047c7f9
commit
684cd676e5
1 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue