in src/js/popup.js [2312:2346]
initialize() {
Utils.addEnterHandler(document.querySelector("#delete-container-cancel-link"), () => {
const identity = Logic.currentIdentity();
Logic.showPanel(P_CONTAINER_EDIT, identity, false, false);
});
Utils.addEnterHandler(document.querySelector("#close-container-delete-panel"), () => {
const identity = Logic.currentIdentity();
Logic.showPanel(P_CONTAINER_EDIT, identity, false, false);
});
Utils.addEnterHandler(document.querySelector("#delete-container-ok-link"), async () => {
/* Strip "containerEdit" and "containerInfo" panels out of previousPanelPath so that
a user is not returned to either an edit, or info panel for a container
that has been deleted and no longer exists.
*/
while (
Logic._previousPanelPath[Logic._previousPanelPath.length - 1] === "containerEdit" ||
Logic._previousPanelPath[Logic._previousPanelPath.length - 1] === "containerInfo") {
Logic._previousPanelPath.pop();
}
/* This promise wont resolve if the last tab was removed from the window.
as the message async callback stops listening, this isn't an issue for us however it might be in future
if you want to do anything post delete do it in the background script.
Browser console currently warns about not listening also.
*/
try {
await Logic.removeIdentity(Utils.userContextId(Logic.currentIdentity().cookieStoreId));
await Logic.refreshIdentities();
Logic.showPreviousPanel();
} catch (e) {
Logic.showPreviousPanel();
}
});
},