Skip to content

Commit

Permalink
Manual update and clear data fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Mar 30, 2022
1 parent 65b7a95 commit b69d3ce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 37 deletions.
2 changes: 1 addition & 1 deletion app/application/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h5 class="build-content m-0 mx-3 flex flex-row text-center font-bold">You are r
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-1" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" />
</svg>
Manual update
Download update
</button>
<button type="button" onclick="releaseNotes()" class="relative -top-2.5 cursor-pointer rounded-full border-2 border-white bg-white py-1 px-3 text-center text-base font-bold text-black transition duration-200 ease-in hover:bg-transparent hover:text-white">
<svg xmlns="http://www.w3.org/2000/svg" class="relative top-1" height="20" width="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand Down
2 changes: 1 addition & 1 deletion app/application/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ const releaseNotes = () => {
* Download manual update
*/
const manualUpdate = () => {
ipc.send("manualUpdate")
shell.openExternal("https://authme.levminer.com/#downloads")
}

/**
Expand Down
10 changes: 7 additions & 3 deletions app/settings/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ const clearData = () => {

// exit aoo
setTimeout(() => {
app.quit()
app.exit()
}, 300)
}
})
Expand Down Expand Up @@ -901,8 +901,12 @@ const menu = (name) => {

let /** @type{LibStorage} */ storage = dev ? JSON.parse(localStorage.getItem("dev_storage")) : JSON.parse(localStorage.getItem("storage"))

if (storage.settings_page !== "general" && storage.settings_page !== undefined) {
menu(storage.settings_page)
try {
if (storage.settings_page !== "general" && storage.settings_page !== undefined) {
menu(storage.settings_page)
}
} catch (error) {
console.log("Error getting settings page")
}

/**
Expand Down
33 changes: 1 addition & 32 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ const createWindows = () => {
* Event when landing window opens
*/
window_confirm.on("show", () => {
// Hide window if launch on startup on
if (reload === false && settings.settings.launch_on_startup === true && args[1] === "--hidden") {
confirm_shown = false

Expand Down Expand Up @@ -1388,38 +1389,6 @@ ipc.on("releaseNotes", () => {
releaseNotes()
})

/**
* Look for manual update
*/
ipc.on("manualUpdate", () => {
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: ["Download", lang.button.close],
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")
}
})
}
})
.catch((error) => {
dialog.showErrorBox("Authme", "Error getting latest update. \n\nTry again later!")

logger.error("Error getting latest update", error.stack)
})
})

/**
* Show support Authme dialog
*/
Expand Down

0 comments on commit b69d3ce

Please sign in to comment.