Skip to content

Commit

Permalink
Fix saving window position
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Mar 30, 2022
1 parent 710f2c4 commit b36a7b7
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,17 +429,6 @@ const createWindows = () => {
wco = true
}

/**
* Listen to app quit
*/
app.on("quit", (event) => {
event.preventDefault()

saveSettings()

app.exit()
})

/**
* Set window bounds
*/
Expand Down Expand Up @@ -690,6 +679,10 @@ const createWindows = () => {
}
}

const window_position = settings.window
settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))
settings.window = window_position

saveSettings()

logger.log("Application closed")
Expand Down Expand Up @@ -777,10 +770,6 @@ const createWindows = () => {
if (res.data.tag_name > authme_version && res.data.tag_name != undefined && res.data.prerelease != true) {
window_application.webContents.executeJavaScript("showUpdate()")

window_settings.on("show", () => {
window_settings.webContents.executeJavaScript("showUpdate()")
})

logger.log("Manual update found!")
} else {
logger.log("No manual update found!")
Expand Down Expand Up @@ -946,10 +935,6 @@ const createWindows = () => {
window_application.on("show", () => {
window_application.webContents.executeJavaScript("showInfo()")
})

window_settings.on("show", () => {
window_settings.webContents.executeJavaScript("showInfo()")
})
}

if (settings.statistics.rate === true && settings.statistics.feedback === true) {
Expand Down

0 comments on commit b36a7b7

Please sign in to comment.