fix the onboarding show up on browser restart

This commit is contained in:
Son NK
2021-01-27 19:55:12 +01:00
parent 1e624263c8
commit 3c66281f6b
+15 -13
View File
@@ -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 };