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

fix: the app update fails when I open "Quick Ask" #2467

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion electron/handlers/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,7 @@ export function handleAppUpdates() {
message: 'Would you like to download and install it now?',
buttons: ['Download', 'Later'],
})
trayManager.destroyCurrentTray()

if (action.response === 0) await autoUpdater.downloadUpdate()
})

Expand All @@ -38,6 38,7 @@ export function handleAppUpdates() {
buttons: ['Restart', 'Later'],
})
if (action.response === 0) {
trayManager.destroyCurrentTray()
waitingToInstallVersion = _info?.version
autoUpdater.quitAndInstall()
}
Expand Down
4 changes: 2 additions & 2 deletions electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 11,7 @@ import { getAppConfigurations, log } from '@janhq/core/node'
* IPC Handlers
**/
import { injectHandler } from './handlers/common'
import { handleAppUpdates } from './handlers/update'
import { handleAppUpdates, waitingToInstallVersion } from './handlers/update'
import { handleAppIPCs } from './handlers/native'

/**
Expand Down Expand Up @@ -96,7 96,7 @@ app.once('quit', () => {

app.once('window-all-closed', () => {
// Feature Toggle for Quick Ask
if (getAppConfigurations().quick_ask) return
if (getAppConfigurations().quick_ask && !waitingToInstallVersion) return
cleanUpAndQuit()
})

Expand Down
Loading