Auto-open options page when not configured

This commit is contained in:
Ian Gulliver
2022-10-20 20:53:08 -07:00
parent 787df16a48
commit eb3787c59b

View File

@@ -23,6 +23,12 @@ const activeIcon = {
}
async function handleClick(tab, e) {
const cfg = await browser.storage.sync.get();
if (!cfg.token || !cfg.workspace || !cfg.assignee) {
await browser.runtime.openOptionsPage();
return;
}
if (e.modifiers.includes('Shift')) {
await sendPaste();
return;
@@ -106,6 +112,10 @@ async function handleChangeInt(e) {
}
async function create(cfg, task) {
if (!cfg.workspace || !cfg.assignee) {
throw 'missing workspace/assignee';
}
const req = {
data: {
workspace: cfg.workspace,