Added clean up of proxy association after container deletion

This commit is contained in:
Samuel Crypto
2018-11-02 07:47:29 -04:00
parent 8ee45a38f0
commit f47b4c8f6c
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -148,17 +148,17 @@ proxifiedContainers = {
}
},
//Deletes the proxy information object for a specified cookieStoreId [useful for cleaning]
// Deletes the proxy information object for a specified cookieStoreId [useful for cleaning]
delete(cookieStoreId) {
return new Promise((resolve, reject) => {
// Assumes proxy is a properly formatted object
proxifiedContainers.retrieve().then((proxifiedContainersStore) => {
let index = proxifiedContainersStore.findIndex(i => i.cookieStoreId === cookieStoreId);
const index = proxifiedContainersStore.findIndex(i => i.cookieStoreId === cookieStoreId);
if (index === -1) {
reject({error: "not-found", message: `Container '${cookieStoreId}' not found.`});
} else {
delete proxifiedContainersStore[index];
proxifiedContainersStore.splice(index, 1);
}
browser.storage.local.set({