diff --git a/src/background/onboarding.js b/src/background/onboarding.js index f12ca2f..9a77f14 100644 --- a/src/background/onboarding.js +++ b/src/background/onboarding.js @@ -11,25 +11,27 @@ function initService() { await browser.tabs.create({ url: browser.runtime.getURL("/onboarding/index.html"), }); - } - }); - // listen for post-setup screen - browser.cookies.onChanged.addListener(async function (info) { - const { removed, cookie } = info; - if (!removed && cookie.name === "setup_done") { - const currentTab = await browser.tabs.query({ - active: true, - currentWindow: true, - }); + // listen for post-setup screen + browser.cookies.onChanged.addListener(async function (info) { + const { removed, cookie } = info; + if (!removed && cookie.name === "setup_done") { + const currentTab = await browser.tabs.query({ + active: true, + currentWindow: true, + }); - await delay(100); + await delay(100); - await browser.tabs.update(currentTab[0].id, { - url: browser.runtime.getURL("/onboarding/index.html#step3"), + await browser.tabs.update(currentTab[0].id, { + url: browser.runtime.getURL("/onboarding/index.html#step3"), + }); + } }); } }); + + } export default { initService };