Auto-open options page when not configured
This commit is contained in:
@@ -23,6 +23,12 @@ const activeIcon = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleClick(tab, e) {
|
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')) {
|
if (e.modifiers.includes('Shift')) {
|
||||||
await sendPaste();
|
await sendPaste();
|
||||||
return;
|
return;
|
||||||
@@ -106,6 +112,10 @@ async function handleChangeInt(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function create(cfg, task) {
|
async function create(cfg, task) {
|
||||||
|
if (!cfg.workspace || !cfg.assignee) {
|
||||||
|
throw 'missing workspace/assignee';
|
||||||
|
}
|
||||||
|
|
||||||
const req = {
|
const req = {
|
||||||
data: {
|
data: {
|
||||||
workspace: cfg.workspace,
|
workspace: cfg.workspace,
|
||||||
|
|||||||
Reference in New Issue
Block a user