优化客户端升级提示

This commit is contained in:
kuaifan 2022-02-23 16:45:38 +08:00
parent 337b3e5b5d
commit 65393b7809
2 changed files with 6 additions and 5 deletions

View File

@ -188,7 +188,7 @@ export default {
return true;
}
}
this.$Electron.registerMsgListener('dispatch', (event, args) => {
this.$Electron.registerMsgListener('dispatch', args => {
if (!$A.isJson(args)) {
return;
}

View File

@ -44,8 +44,8 @@ export default {
this.getReleases();
//
if (this.$Electron) {
this.$Electron.registerMsgListener('downloadDone', (event, {result}) => {
if (result.name == this.repoData.name) {
this.$Electron.registerMsgListener('downloadDone', ({result}) => {
if (result.name == this.repoData.name && this.repoStatus !== 2) {
this.downloadResult = result;
this.releasesNotification()
}
@ -202,6 +202,7 @@ export default {
},
releasesNotification() {
const {tag_name, body} = this.repoReleases;
$A.modalConfirm({
okText: this.$L('立即更新'),
onOk: () => {
@ -224,12 +225,12 @@ export default {
props: {
color: 'volcano'
}
}, this.repoReleases.tag_name)
}, tag_name)
]),
h('MarkdownPreview', {
class: 'notification-body',
props: {
initialValue: this.repoReleases.body
initialValue: body
}
}),
])