Skip to content

Commit

Permalink
feat: Show available update's version
Browse files Browse the repository at this point in the history
  • Loading branch information
ashchan committed Aug 13, 2019
1 parent 4e73cac commit 37c8639
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions packages/neuron-wallet/src/controllers/update.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dialog } from 'electron'
import { autoUpdater } from 'electron-updater'
import { autoUpdater, UpdateInfo } from 'electron-updater'
import i18n from 'utils/i18n'

export default class UpdateController {
Expand Down Expand Up @@ -27,11 +27,13 @@ export default class UpdateController {
this.enableSender()
})

autoUpdater.on('update-available', () => {
autoUpdater.on('update-available', (info: UpdateInfo) => {
const { version } = info
dialog.showMessageBox(
{
type: 'info',
message: i18n.t('updater.updates-found-do-you-want-to-update'),
title: version,
message: i18n.t('updater.updates-found-do-you-want-to-update', { version }),
buttons: [i18n.t('updater.update-now'), i18n.t('common.no')],
},
buttonIndex => {
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default {
},
updater: {
'update-not-available': 'There are currently no updates available.',
'updates-found-do-you-want-to-update': 'An update is available, do you want to update now?',
'updates-found-do-you-want-to-update': 'An update ({{version}}) is available, do you want to update now?',
'update-now': 'Update now',
'updates-downloaded-about-to-quit-and-install': 'Update downloaded. Neuron will quit and install the update...',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-wallet/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default {
},
updater: {
'update-not-available': '没有可供升级的新版本。',
'updates-found-do-you-want-to-update': '有可供升级的新版本。马上进行升级吗?',
'updates-found-do-you-want-to-update': '有可供升级的新版本({{version}})。现在进行升级吗?',
'update-now': '马上升级',
'updates-downloaded-about-to-quit-and-install': '下载完成。Neuron 将退出并安装新版本...',
},
Expand Down

0 comments on commit 37c8639

Please sign in to comment.