Make showTutorial() async so await can be used.

master
Jorg Knobloch 2 years ago
parent a52e56f5b7
commit bcd5f85b25

@ -12,10 +12,7 @@ init();
browser.runtime.onStartup.addListener(() => browser.windows.onCreated.addListener(showTutorial));
function showTutorial() {
async function showTutorial() {
browser.windows.onCreated.removeListener(showTutorial);
browser.pEp4Tb.shouldShowTutorial().then((doit) => {
if (doit) browser.tabs.create({ url: "content/tutorial/tutorial.html" });
});
if (await browser.pEp4Tb.shouldShowTutorial()) browser.tabs.create({ url: "content/tutorial/tutorial.html" });
}

Loading…
Cancel
Save