no message

This commit is contained in:
kuaifan 2022-04-08 08:01:24 +08:00
parent 6c44abded9
commit 86886ded16
4 changed files with 16 additions and 10 deletions

14
electron/electron.js vendored
View File

@ -118,9 +118,11 @@ function createSubWindow(args) {
})
browser.on('close', event => {
utils.onBeforeUnload(event).then(() => {
event.sender.destroy()
})
if (!willQuitApp) {
utils.onBeforeUnload(event).then(() => {
event.sender.destroy()
})
}
})
browser.on('closed', () => {
@ -187,7 +189,7 @@ app.on('activate', () => {
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
if (willQuitApp || process.platform !== 'darwin') {
app.quit()
}
})
@ -439,8 +441,8 @@ ipcMain.on('updateCheckAndDownload', (event, args) => {
*/
ipcMain.on('updateQuitAndInstall', (event) => {
event.returnValue = "ok"
autoUpdater.quitAndInstall()
app.quit()
willQuitApp = true
setTimeout(() => autoUpdater.quitAndInstall(), 1)
})
//================================================================

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
251c1fcec9ce9d71
d15abd25e49c5bc9

View File

@ -29,7 +29,7 @@
<MarkdownPreview class="notification-body overlay-y" :initialValue="updateNote"/>
<div slot="footer" class="adaption">
<Button type="default" @click="updateShow=false">{{$L('稍后')}}</Button>
<Button type="primary" @click="updateQuitAndInstall">{{$L($Platform === 'mac' ? '重新启动' : '立即升级')}}</Button>
<Button type="primary" :loading="updateIng" @click="updateQuitAndInstall">{{$L($Platform === 'mac' ? '重新启动' : '立即升级')}}</Button>
</div>
</Modal>
</div>
@ -55,6 +55,7 @@ export default {
updateVersion: '',
updateNote: '',
updateShow: false,
updateIng: false,
downloadUrl: '',
}
@ -158,7 +159,10 @@ export default {
},
updateQuitAndInstall() {
this.$Electron.sendMessage('updateQuitAndInstall')
this.updateIng = true
setTimeout(() => {
this.$Electron.sendMessage('updateQuitAndInstall')
}, 301)
},
useSSOLogin() {