Skip to content

Commit

Permalink
Merge branch 'pdehaan-removeDomain' into upgrade-web-ext
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxcrawford committed Jun 13, 2023
2 parents 2f67338 + add595b commit 0a3b165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const isSiteInContainer = async(panelId) => {

const activeRootDomain = await getActiveRootDomainFromBackground();

if (addedSitesList.includes(activeRootDomain)) {
if (addedSitesList && addedSitesList.includes(activeRootDomain)) {
return true;
}
};
Expand Down Expand Up @@ -345,7 +345,7 @@ document.addEventListener("DOMContentLoaded", async () => {
const storage = await browser.storage.local.get();
const currentPanel = storage.CURRENT_PANEL;

const onboarding = (currentPanel.includes("onboarding"));
const onboarding = (currentPanel && currentPanel.includes("onboarding"));
if (!onboarding) {
return buildPanel(currentPanel);
}
Expand Down
6 changes: 6 additions & 0 deletions test/features/add-domain-to-fbc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ describe("Add domain to Facebook Container", () => {
removeDomain: "example.com"
});

await sleep();

const [promise] = await background.browser.runtime.onMessage.addListener.yield({message: "what-sites-are-added"});
const sites = await promise;
expect(sites.includes("example.com")).to.be.false;
Expand All @@ -39,3 +41,7 @@ describe("Add domain to Facebook Container", () => {
});

});

async function sleep(ms = 100) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

0 comments on commit 0a3b165

Please sign in to comment.