mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
perf: 升级客户端框架
This commit is contained in:
parent
aba74681ef
commit
4ed09dddcf
6
electron/electron.js
vendored
6
electron/electron.js
vendored
@ -79,7 +79,7 @@ function createMainWindow() {
|
||||
|
||||
mainWindow.on('close', event => {
|
||||
if (!willQuitApp) {
|
||||
utils.onBeforeUnload(event).then(() => {
|
||||
utils.onBeforeUnload(event, mainWindow).then(() => {
|
||||
if (process.platform === 'win32') {
|
||||
mainWindow.hide()
|
||||
} else if (process.platform === 'darwin') {
|
||||
@ -139,8 +139,8 @@ function createSubWindow(args) {
|
||||
|
||||
browser.on('close', event => {
|
||||
if (!willQuitApp) {
|
||||
utils.onBeforeUnload(event).then(() => {
|
||||
event.sender.destroy()
|
||||
utils.onBeforeUnload(event, browser).then(() => {
|
||||
browser.destroy()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@ -26,14 +26,14 @@
|
||||
"url": "https://github.com/kuaifan/dootask.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@electron-forge/cli": "^6.1.1",
|
||||
"@electron-forge/maker-deb": "^6.1.1",
|
||||
"@electron-forge/maker-rpm": "^6.1.1",
|
||||
"@electron-forge/maker-squirrel": "^6.1.1",
|
||||
"@electron-forge/maker-zip": "^6.1.1",
|
||||
"@electron-forge/cli": "^6.3.0",
|
||||
"@electron-forge/maker-deb": "^6.3.0",
|
||||
"@electron-forge/maker-rpm": "^6.3.0",
|
||||
"@electron-forge/maker-squirrel": "^6.3.0",
|
||||
"@electron-forge/maker-zip": "^6.3.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"electron": "^24.5.0",
|
||||
"electron-builder": "^23.6.0",
|
||||
"electron": "^25.5.0",
|
||||
"electron-builder": "^24.6.3",
|
||||
"electron-notarize": "^1.2.2",
|
||||
"form-data": "^4.0.0",
|
||||
"ora": "^4.1.1"
|
||||
@ -44,7 +44,7 @@
|
||||
"electron-log": "^4.4.8",
|
||||
"electron-screenshots-tool": "^1.0.4",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"electron-updater": "^5.3.0",
|
||||
"electron-updater": "^6.1.1",
|
||||
"fs-extra": "^10.1.0",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"request": "^2.88.2"
|
||||
|
||||
5
electron/utils.js
vendored
5
electron/utils.js
vendored
@ -291,12 +291,11 @@ module.exports = {
|
||||
*/
|
||||
onBeforeUnload(event, app) {
|
||||
return new Promise(resolve => {
|
||||
const sender = event.sender
|
||||
const contents = sender.webContents
|
||||
const contents = app.webContents
|
||||
if (contents != null) {
|
||||
contents.executeJavaScript('if(typeof window.__onBeforeUnload === \'function\'){window.__onBeforeUnload()}', true).then(options => {
|
||||
if (this.isJson(options)) {
|
||||
let choice = dialog.showMessageBoxSync(sender, options)
|
||||
let choice = dialog.showMessageBoxSync(app, options)
|
||||
if (choice === 1) {
|
||||
contents.executeJavaScript('if(typeof window.__removeBeforeUnload === \'function\'){window.__removeBeforeUnload()}', true).catch(() => {});
|
||||
resolve()
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
"css-loader": "^6.7.2",
|
||||
"dexie": "^3.2.3",
|
||||
"echarts": "^5.2.2",
|
||||
"element-sea": "^2.15.10-5",
|
||||
"element-sea": "^2.15.10-6",
|
||||
"file-loader": "^6.2.0",
|
||||
"highlight.js": "^11.7.0",
|
||||
"inquirer": "^8.2.0",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user