mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-17 03:44:25 +03:00
Comments and added delete
This commit is contained in:
9
SB.js
9
SB.js
@@ -20,7 +20,9 @@ class MapIO {
|
||||
}
|
||||
|
||||
set(key, value) {
|
||||
// Proxy to map
|
||||
this.map.set(key, value);
|
||||
// Store updated map locally
|
||||
chrome.storage.sync.set({
|
||||
[this.id]: encodeStoredItem(this.map)
|
||||
});
|
||||
@@ -37,7 +39,9 @@ class MapIO {
|
||||
|
||||
deleteProperty(key) {
|
||||
if (this.map.has(key)) {
|
||||
// Proxy to map
|
||||
this.map.delete(key);
|
||||
// Store updated map locally
|
||||
chrome.storage.sync.set({
|
||||
[this.id]: encodeStoredItem(this.map)
|
||||
});
|
||||
@@ -52,7 +56,12 @@ class MapIO {
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
// Proxy to map
|
||||
this.map.delete(key);
|
||||
// Store updated map locally
|
||||
chrome.storage.sync.set({
|
||||
[this.id]: encodeStoredItem(this.map)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user