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

View File

@ -118,9 +118,11 @@ function createSubWindow(args) {
}) })
browser.on('close', event => { browser.on('close', event => {
if (!willQuitApp) {
utils.onBeforeUnload(event).then(() => { utils.onBeforeUnload(event).then(() => {
event.sender.destroy() event.sender.destroy()
}) })
}
}) })
browser.on('closed', () => { browser.on('closed', () => {
@ -187,7 +189,7 @@ app.on('activate', () => {
}) })
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
if (process.platform !== 'darwin') { if (willQuitApp || process.platform !== 'darwin') {
app.quit() app.quit()
} }
}) })
@ -439,8 +441,8 @@ ipcMain.on('updateCheckAndDownload', (event, args) => {
*/ */
ipcMain.on('updateQuitAndInstall', (event) => { ipcMain.on('updateQuitAndInstall', (event) => {
event.returnValue = "ok" event.returnValue = "ok"
autoUpdater.quitAndInstall() willQuitApp = true
app.quit() 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"/> <MarkdownPreview class="notification-body overlay-y" :initialValue="updateNote"/>
<div slot="footer" class="adaption"> <div slot="footer" class="adaption">
<Button type="default" @click="updateShow=false">{{$L('稍后')}}</Button> <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> </div>
</Modal> </Modal>
</div> </div>
@ -55,6 +55,7 @@ export default {
updateVersion: '', updateVersion: '',
updateNote: '', updateNote: '',
updateShow: false, updateShow: false,
updateIng: false,
downloadUrl: '', downloadUrl: '',
} }
@ -158,7 +159,10 @@ export default {
}, },
updateQuitAndInstall() { updateQuitAndInstall() {
this.updateIng = true
setTimeout(() => {
this.$Electron.sendMessage('updateQuitAndInstall') this.$Electron.sendMessage('updateQuitAndInstall')
}, 301)
}, },
useSSOLogin() { useSSOLogin() {