diff --git a/background.js b/background.js index b457328..d8ec2b2 100644 --- a/background.js +++ b/background.js @@ -873,11 +873,11 @@ function canceled(account, id/* , tab */) { console.log(account, id); const upload = uploads.get(id); if (upload) { - if (!upload.canceled) { + if (upload.canceled) { + notification("❌ Upload already canceled", `Error: Upload of the “${upload.file.name}” file was already canceled.`); + } else { upload.canceled = true; notification("ℹ️ Canceling upload", `Canceling upload of the “${upload.file.name}” file.`); - } else { - notification("❌ Upload already canceled", `Error: Upload of the “${upload.file.name}” file was already canceled.`); } } else { notification("❌ Unable to find file", "Error: Unable to find file to cancel upload. It may have already been deleted."); @@ -978,10 +978,9 @@ init(); browser.runtime.onMessage.addListener(async (message, sender) => { // console.log(message); switch (message.type) { - case BACKGROUND: { + case BACKGROUND: setSettings(message.optionValue); break; - } case VERIFY: { const response = { type: VERIFY, diff --git a/common.js b/common.js index 8974f5f..0c0e6b4 100644 --- a/common.js +++ b/common.js @@ -18,7 +18,7 @@ export const numberFormat = new Intl.NumberFormat(); * @returns {string} */ export function outputunit(number, scale) { - let str = ""; + let str; const scale_base = scale ? 1000 : 1024; diff --git a/popup/popup.js b/popup/popup.js index 97b1532..1aada86 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -153,7 +153,7 @@ document.getElementById("toggle").addEventListener("change", (event) => { password.focus(); }); -document.getElementById("generate").addEventListener("click", (event) => { +document.getElementById("generate").addEventListener("click", (/* event */) => { let apassword = ""; let atext = ""; @@ -199,7 +199,7 @@ document.getElementById("settings").addEventListener("click", (event) => { }); }); -addEventListener("beforeunload", (event) => { +addEventListener("beforeunload", (/* event */) => { if (!eventHasBeenSend) { const response = { type: POPUP,