mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Delete empty unsubmitted submissions when delete is called
This commit is contained in:
@@ -109,7 +109,15 @@ class SBMap<T, U> extends Map {
|
|||||||
delete(key) {
|
delete(key) {
|
||||||
const result = super.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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user