Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Apr 8, 2022
1 parent 6c44abd commit 86886de
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
14 changes: 8 additions & 6 deletions electron/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -187,7 +189,7 @@ app.on('activate', () => {
})

app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
if (willQuitApp || process.platform !== 'darwin') {
app.quit()
}
})
Expand Down Expand Up @@ -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)
})

//================================================================
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
251c1fcec9ce9d71
d15abd25e49c5bc9
8 changes: 6 additions & 2 deletions resources/assets/js/components/RightBottom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -55,6 +55,7 @@ export default {
updateVersion: '',
updateNote: '',
updateShow: false,
updateIng: false,
downloadUrl: '',
}
Expand Down Expand Up @@ -158,7 +159,10 @@ export default {
},
updateQuitAndInstall() {
this.$Electron.sendMessage('updateQuitAndInstall')
this.updateIng = true
setTimeout(() => {
this.$Electron.sendMessage('updateQuitAndInstall')
}, 301)
},
useSSOLogin() {
Expand Down

0 comments on commit 86886de

Please sign in to comment.