Skip to content

Commit

Permalink
Fix app showing on startup #203
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Apr 15, 2022
1 parent d613096 commit b194022
Showing 1 changed file with 13 additions and 36 deletions.
49 changes: 13 additions & 36 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let /** @type{BrowserWindow} */ window_edit
*/
let landing_shown = false
let confirm_shown = false
let application_shown = true
let application_shown = false
let settings_shown = false
let import_shown = false
let export_shown = false
Expand All @@ -48,7 +48,6 @@ let edit_shown = false
*/
let authenticated = false
let shortcuts = false
let hidden = false
let tray_minimized = false
let update_seen = false
let manual_update = false
Expand Down Expand Up @@ -778,18 +777,6 @@ const createWindows = () => {
})
}

// Hide window if launch on startup on
if (hidden === false && settings.settings.launch_on_startup === true && args[1] === "--hidden") {
application_shown = false

window_application.hide()

hidden = true

createTray()
createMenu()
}

// Check for manual update
if (update_seen == false && platform !== "windows") {
api()
Expand All @@ -798,24 +785,6 @@ const createWindows = () => {
}
})

/**
* Event when landing window opens
*/
window_confirm.on("show", () => {
// Hide window if launch on startup on
if (hidden === false && settings.settings.launch_on_startup === true && args[1] === "--hidden") {
application_shown = false
confirm_shown = false

window_confirm.hide()

hidden = true

createTray()
createMenu()
}
})

/**
* Show animations and focus searchbar on windows focus
*/
Expand Down Expand Up @@ -1046,8 +1015,12 @@ app.whenReady()
settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))

setTimeout(() => {
window_confirm.maximize()
window_confirm.show()
if (args[1] !== "--hidden") {
window_confirm.maximize()
window_confirm.show()

confirm_shown = true
}

setTimeout(() => {
window_landing.destroy()
Expand All @@ -1063,8 +1036,12 @@ app.whenReady()
settings = JSON.parse(fs.readFileSync(path.join(folder_path, "settings", "settings.json"), "utf-8"))

setTimeout(() => {
window_application.maximize()
window_application.show()
if (args[1] !== "--hidden") {
window_application.maximize()
window_application.show()

application_shown = true
}

setTimeout(() => {
window_confirm.destroy()
Expand Down

0 comments on commit b194022

Please sign in to comment.