Skip to content

Commit 37c8639

Browse files
committed
feat: Show available update's version
1 parent 4e73cac commit 37c8639

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

packages/neuron-wallet/src/controllers/update.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dialog } from 'electron'
2-
import { autoUpdater } from 'electron-updater'
2+
import { autoUpdater, UpdateInfo } from 'electron-updater'
33
import i18n from 'utils/i18n'
44

55
export default class UpdateController {
@@ -27,11 +27,13 @@ export default class UpdateController {
2727
this.enableSender()
2828
})
2929

30-
autoUpdater.on('update-available', () => {
30+
autoUpdater.on('update-available', (info: UpdateInfo) => {
31+
const { version } = info
3132
dialog.showMessageBox(
3233
{
3334
type: 'info',
34-
message: i18n.t('updater.updates-found-do-you-want-to-update'),
35+
title: version,
36+
message: i18n.t('updater.updates-found-do-you-want-to-update', { version }),
3537
buttons: [i18n.t('updater.update-now'), i18n.t('common.no')],
3638
},
3739
buttonIndex => {

packages/neuron-wallet/src/locales/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default {
137137
},
138138
updater: {
139139
'update-not-available': 'There are currently no updates available.',
140-
'updates-found-do-you-want-to-update': 'An update is available, do you want to update now?',
140+
'updates-found-do-you-want-to-update': 'An update ({{version}}) is available, do you want to update now?',
141141
'update-now': 'Update now',
142142
'updates-downloaded-about-to-quit-and-install': 'Update downloaded. Neuron will quit and install the update...',
143143
},

packages/neuron-wallet/src/locales/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export default {
136136
},
137137
updater: {
138138
'update-not-available': '没有可供升级的新版本。',
139-
'updates-found-do-you-want-to-update': '有可供升级的新版本。马上进行升级吗?',
139+
'updates-found-do-you-want-to-update': '有可供升级的新版本({{version}})。现在进行升级吗?',
140140
'update-now': '马上升级',
141141
'updates-downloaded-about-to-quit-and-install': '下载完成。Neuron 将退出并安装新版本...',
142142
},

0 commit comments

Comments
 (0)