docs: update package.json

master
qier222 4 years ago
parent 51d11e8316
commit a74a55544b

@ -1,6 +1,6 @@
{
"name": "YesPlayMusic",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"description": "A third party music application for Netease Music",
"author": "hawtim<hawtimzhang@gmail.com>",

@ -1,4 +1,4 @@
import { app, ipcMain } from "electron";
import { app, ipcMain, dialog } from "electron";
import match from "@njzy/unblockneteasemusic";
export function initIpcMain(win, store) {
@ -25,20 +25,21 @@ export function initIpcMain(win, store) {
});
});
ipcMain.on('close', (e) => {
if (process.platform == 'darwin') {
//判断mac
ipcMain.on("close", (e) => {
if (process.platform == "darwin") {
win.hide();
})
e.preventDefault()//阻止默认行为
dialog.showMessageBox({
type: 'info',
title: 'Information',
}
e.preventDefault(); //阻止默认行为
dialog
.showMessageBox({
type: "info",
title: "Information",
cancelId: 2,
defaultId: 0,
message: '确定要关闭吗?',
buttons: ['最小化','直接退出']
}).then(result => {
message: "确定要关闭吗?",
buttons: ["最小化", "直接退出"],
})
.then((result) => {
if (result.response == 0) {
e.preventDefault(); //阻止默认行为
win.minimize(); //调用 最小化实例方法
@ -47,11 +48,11 @@ export function initIpcMain(win, store) {
//app.quit();
app.exit(); //exit()直接关闭客户端不会执行quit();
}
}).catch(err => {
console.log(err)
})
.catch((err) => {
console.log(err);
});
});
ipcMain.on("minimize", () => {
win.minimize();

Loading…
Cancel
Save