Skip to content

Commit

Permalink
Merge pull request #609 from mozilla/608-add-site-removal-confirmation
Browse files Browse the repository at this point in the history
Fixed #608 - Added removal confirmation
  • Loading branch information
groovecoder committed Mar 4, 2020
2 parents 4aa9ed0 + 5fdd827 commit e6d9efa
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ const setCustomSiteButtonEvent = async (panelId) => {
if (shouldShowRemoveSiteButton) {
const removeSiteFromContainerLink = document.querySelector(".remove-site-from-container");
removeSiteFromContainerLink.addEventListener(
"click", async () => removeSiteFromContainer()
"click", async () => {
const activeRootDomain = await getActiveRootDomainFromBackground();
buildRemoveSitePanel(activeRootDomain);
}
);
return;
}
Expand Down Expand Up @@ -555,17 +558,6 @@ const buildAllowedSitesPanel = async(panelId) => {
getLocalizedStrings();
};

const removeSiteFromContainer = async () => {
const activeRootDomain = await getActiveRootDomainFromBackground();

await browser.runtime.sendMessage({
message: "remove-domain-from-list",
removeDomain: activeRootDomain
});
browser.tabs.reload();
window.close();
};

const addSiteToContainer = async () => {
const activeRootDomain = await getActiveRootDomainFromBackground();
const fbcStorage = await browser.storage.local.get();
Expand Down

0 comments on commit e6d9efa

Please sign in to comment.