From 3f6e24456eaeb4454537e41cbb4707c4ec323eaa Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 19 Oct 2022 00:07:19 -0700 Subject: [PATCH] Better function order --- background.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/background.js b/background.js index 8bf4ff2..b312eb3 100644 --- a/background.js +++ b/background.js @@ -43,6 +43,17 @@ async function handleClick(tab, e) { } } +async function sendPaste() { + const clip = await navigator.clipboard.readText(); + + const store = {}; + store[`create_${crypto.randomUUID()}`] = { + name: 'Paste', + html_notes: `${escapeHTML(clip)}`, + }; + await browser.storage.local.set(store); +} + let inHandleChange = false; async function handleChange(e) { @@ -80,17 +91,6 @@ async function handleChangeInt(e) { await browser.storage.local.remove([key]); } -async function sendPaste() { - const clip = await navigator.clipboard.readText(); - - const store = {}; - store[`create_${crypto.randomUUID()}`] = { - name: 'Paste', - html_notes: `${escapeHTML(clip)}`, - }; - await browser.storage.local.set(store); -} - async function create(cfg, task) { const req = { data: {