Skip to content

Commit cada766

Browse files
authored
[UX] Improve update Dialog (#3598)
* Fix changelog button * Fix changelog button * update_package_json
1 parent 4c0aba6 commit cada766

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

public/locales/en/translation.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"message": "Heroic cache cleared.",
2424
"title": "Cache cleared"
2525
},
26+
"changelog": "Changelog",
2627
"choose": "Choose",
2728
"choose-egs-prefix": "Choose Prefix where EGS is installed",
2829
"choose-gogdl-binary": "Select GOGDL Binary (needs restart)",
@@ -83,7 +84,6 @@
8384
},
8485
"info": {
8586
"update": {
86-
"changelog": "Open changelog",
8787
"detail": "Do you want to download the update in the background?",
8888
"message": "There is a new Version available!",
8989
"message-finished": "Do you want to restart Heroic now?",
@@ -93,6 +93,7 @@
9393
},
9494
"no": "NO",
9595
"ok": "OK",
96+
"postpone": "Postpone",
9697
"protocol": {
9798
"install": {
9899
"not_installed": "Currently not installed. Install it?"
@@ -126,6 +127,7 @@
126127
"error": "Invalid Path",
127128
"title": "Choose the saves directory"
128129
},
130+
"update": "Update",
129131
"vcruntime": {
130132
"install": {
131133
"message": "The download links for the Visual C++ Runtimes have been opened. Please install both the x86 and x64 versions."

src/backend/updater.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,34 @@ import { logError, LogPrefix } from './logger/logger'
99
autoUpdater.autoDownload = false
1010
autoUpdater.autoInstallOnAppQuit = false
1111

12-
autoUpdater.on('update-available', async () => {
13-
const { response, checkboxChecked } = await dialog.showMessageBox({
12+
async function showAutoupdateDialog() {
13+
const { response } = await dialog.showMessageBox({
1414
title: t('box.info.update.title', 'Heroic Games Launcher'),
1515
message: t('box.info.update.message', 'There is a new Version available!'),
1616
detail: t(
1717
'box.info.update.detail',
1818
'Do you want to download the update in the background?'
1919
),
20-
checkboxLabel: t('box.info.update.changelog', 'Open changelog'),
21-
checkboxChecked: false,
20+
2221
icon: nativeImage.createFromPath(icon),
23-
buttons: [t('box.no'), t('box.yes')]
22+
buttons: [
23+
t('box.update', 'Update'),
24+
t('box.postpone', 'Postpone'),
25+
t('box.changelog', 'Changelog')
26+
]
2427
})
25-
if (checkboxChecked) {
28+
if (response === 0) {
29+
autoUpdater.downloadUpdate()
30+
}
31+
if (response === 2) {
2632
shell.openExternal(
2733
'https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases'
2834
)
35+
showAutoupdateDialog()
2936
}
30-
if (response === 1) {
31-
autoUpdater.downloadUpdate()
32-
}
33-
})
37+
}
38+
39+
autoUpdater.on('update-available', showAutoupdateDialog)
3440
autoUpdater.on('update-downloaded', async () => {
3541
const { response } = await dialog.showMessageBox({
3642
title: t('box.info.update.title-finished', 'Update Finished'),

0 commit comments

Comments
 (0)