diff --git a/app/codes/index.html b/app/codes/index.html index 2862cec2..d2844261 100644 --- a/app/codes/index.html +++ b/app/codes/index.html @@ -21,113 +21,6 @@
You are r - - - - - - - - -

Authme

@@ -220,19 +113,5 @@

Save your 2FA codes to your computer for future use.

- - diff --git a/app/codes/index.js b/app/codes/index.js index b2d4d93e..df9818ef 100644 --- a/app/codes/index.js +++ b/app/codes/index.js @@ -463,8 +463,6 @@ const copyCode = (id) => { * Search codes */ const search = () => { - document.querySelector(".infoBar").style.display = "none" - const search = document.querySelector("#search") const input = search.value.toLowerCase() let i = 0 @@ -569,7 +567,7 @@ const showUpdate = () => { * Show info popup */ const showInfo = () => { - document.querySelector(".info").style.display = "block" + return "Removed" } /** @@ -851,67 +849,18 @@ const updateRestart = () => { ipc.send("updateRestart") } -/* info bar */ -const random = Math.floor(Math.random() * 3) - -const infoBar = async () => { - const { opens } = await ipc.invoke("statistics") - const bar = document.querySelector(".bar") - const bar_link = document.querySelector(".barLink") - const info_bar = document.querySelector(".infoBar") - - if (opens % 4 === 0) { - switch (random) { - case 0: - info_bar.style.display = "flex" - bar.textContent = lang.info_bar.feedback - bar_link.textContent = lang.info_bar.feedback_link - break - - case 1: - info_bar.style.display = "flex" - bar.textContent = lang.info_bar.rate - bar_link.textContent = lang.info_bar.rate_link - break - - case 2: - info_bar.style.display = "flex" - bar.textContent = lang.info_bar.translate - bar_link.textContent = lang.info_bar.translate_link - break - - default: - info_bar.style.display = "flex" - break - } - } -} - -infoBar() - -const barLink = () => { - switch (random) { - case 0: - provideFeedback() - break - - case 1: - rateAuthme() - break - - case 2: - shell.openExternal("https://github.com/Levminer/authme/blob/dev/.github/CONTRIBUTING.md#translation") - break - - default: - provideFeedback() - break - } -} - /* Focus search with ctrl+k */ document.addEventListener("keypress", (event) => { if (event.ctrlKey === true && event.code === "KeyK") { focusSearch() } }) + +/* Deprecation notice */ +const date = new Date() +const release = new Date("2021-11-08") + +if (date > release) { + document.querySelector(".deprecation").style.display = "block" + document.querySelector(".deprecationNotice").style.display = "none" +} diff --git a/main.js b/main.js index 692e72ee..526ea280 100644 --- a/main.js +++ b/main.js @@ -67,6 +67,7 @@ let /** @type{Buffer} */ password_buffer = null let /** @type{Tray} */ tray = null let /** @type{Menu} */ menu = null let lang = en +let final = true /** * Check if running in development mode @@ -81,6 +82,7 @@ if (app.isPackaged === false) { }) dev = true + final = false } /** @@ -729,7 +731,7 @@ const createWindows = () => { } // Check for manual update - if (update_seen == false && platform !== "windows") { + if (update_seen == false && platform !== "windows" && final === false) { api() update_seen = true @@ -746,7 +748,7 @@ const createWindows = () => { /** * Auto update on Windows */ - if (dev === false && platform === "windows") { + if (dev === false && platform === "windows" && final === false) { axios .get("https://api.levminer.com/api/v1/authme/releases") .then((res) => { @@ -1943,50 +1945,15 @@ const createMenu = () => { label: lang.menu.update, accelerator: shortcuts ? "" : settings.shortcuts.update, click: () => { - if (platform === "windows") { - if (dev === false) { - manual_update = true - - autoUpdater.checkForUpdates() - } - } else { - axios - .get("https://api.levminer.com/api/v1/authme/releases") - .then((res) => { - if (res.data.tag_name > authme_version && res.data.tag_name != undefined && res.data.prerelease != true) { - dialog - .showMessageBox({ - title: "Authme", - buttons: ["Yes", "No"], - defaultId: 0, - cancelId: 1, - noLink: true, - type: "info", - message: `Update available: Authme ${res.data.tag_name} \n\nDo you want to download it? \n\nYou currently running: Authme ${authme_version}`, - }) - .then((result) => { - if (result.response === 0) { - shell.openExternal("https://authme.levminer.com#downloads") - } - }) - } else { - dialog.showMessageBox({ - title: "Authme", - buttons: [lang.button.close], - defaultId: 0, - cancelId: 1, - noLink: true, - type: "info", - message: `No update available: \n\nYou are running the latest version! \n\nYou are currently running: Authme ${authme_version}`, - }) - } - }) - .catch((error) => { - dialog.showErrorBox("Authme", "Error getting update manually \n\nTry again later!") - - logger.error("Error getting update manually", error.stack) - }) - } + dialog.showMessageBox({ + title: "Authme", + buttons: [lang.button.close], + defaultId: 0, + cancelId: 1, + noLink: true, + type: "info", + message: `No update available: \n\nYou are running the latest version! \n\nYou are currently running: Authme ${authme_version}`, + }) }, }, {