Added clean up of proxy association after container deletion
This commit is contained in:
parent
8ee45a38f0
commit
f47b4c8f6c
2 changed files with 7 additions and 3 deletions
|
@ -32,6 +32,10 @@ const backgroundLogic = {
|
|||
await browser.contextualIdentities.remove(this.cookieStoreId(userContextId));
|
||||
}
|
||||
assignManager.deleteContainer(userContextId);
|
||||
|
||||
// Now remove the identity->proxy association in proxifiedContainers also
|
||||
proxifiedContainers.delete(this.cookieStoreId(userContextId));
|
||||
|
||||
return {done: true, userContextId};
|
||||
},
|
||||
|
||||
|
|
|
@ -153,12 +153,12 @@ proxifiedContainers = {
|
|||
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({
|
||||
|
|
Loading…
Add table
Reference in a new issue