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

[UX] Improve update Dialog #3598

Merged
Merged
Show file tree
Hide file tree
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
Next Next commit
Fix changelog button
  • Loading branch information
Mariaboni committed Feb 26, 2024
commit 736ef5b705223a84f41a35ac297ab836d090d764
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "heroic",
"version": "2.13.0",
"version": "2.12.0",
"versionNames": {
"stable": "Dorry & Broggy",
"beta": "Caesar Clown"
Expand Down
26 changes: 16 additions & 10 deletions src/backend/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,34 @@ import { logError, LogPrefix } from './logger/logger'
autoUpdater.autoDownload = false
autoUpdater.autoInstallOnAppQuit = false

autoUpdater.on('update-available', async () => {
const { response, checkboxChecked } = await dialog.showMessageBox({
async function showAutoupdateDialog() {
const { response } = await dialog.showMessageBox({
title: t('box.info.update.title', 'Heroic Games Launcher'),
message: t('box.info.update.message', 'There is a new Version available!'),
detail: t(
'box.info.update.detail',
'Do you want to download the update in the background?'
),
checkboxLabel: t('box.info.update.changelog', 'Open changelog'),
checkboxChecked: false,

icon: nativeImage.createFromPath(icon),
buttons: [t('box.no'), t('box.yes')]
buttons: [
t('box.update', 'Update'),
t('box.postpone', 'Postpone'),
t('box.changelog', 'Changelog')
]
})
if (checkboxChecked) {
if (response === 0) {
autoUpdater.downloadUpdate()
}
if (response === 2) {
shell.openExternal(
'https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases'
)
showAutoupdateDialog()
}
if (response === 1) {
autoUpdater.downloadUpdate()
}
})
}

autoUpdater.on('update-available', showAutoupdateDialog)
autoUpdater.on('update-downloaded', async () => {
const { response } = await dialog.showMessageBox({
title: t('box.info.update.title-finished', 'Update Finished'),
Expand Down