Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont perform normal close window flow for onboarding window if app is… #1427

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions main/windows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,19 @@ class Onboard {
return
}

const closeHandler = () => {
store.completeOnboarding()
windows.tray.focus()
delete windows.onboard
}

setTimeout(() => {
windows.onboard.once('close', () => {
store.completeOnboarding()
windows.tray.focus()
delete windows.onboard
electronApp.on('before-quit', () => {
windows.onboard.off('close', closeHandler)
})

windows.onboard.once('close', closeHandler)

const area = screen.getDisplayNearestPoint(screen.getCursorScreenPoint()).workArea
const height = (isDev && !fullheight ? devHeight : area.height) - 160
const maxWidth = Math.floor(height * 1.24)
Expand Down Expand Up @@ -510,7 +516,9 @@ const init = () => {
dash.hide()
windows.tray.focus()
}
}, 'windows:dash')

store.observer(() => {
if (store('windows.onboard.showing')) {
if (!windows.onboard) {
onboard = new Onboard()
Expand All @@ -521,7 +529,7 @@ const init = () => {
onboard.hide()
windows.tray.focus()
}
})
}, 'windows:onboard')

store.observer(() => broadcast('permissions', JSON.stringify(store('permissions'))))
store.observer(() => {
Expand Down