mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
refactor: organize codes
This commit is contained in:
parent
df799cbf84
commit
bc0de620c1
23 changed files with 415 additions and 398 deletions
19
src/electron/ipcMain.js
Normal file
19
src/electron/ipcMain.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { app, ipcMain } from "electron";
|
||||
|
||||
export function initIpcMain(win) {
|
||||
// Make vuex copy for electron.
|
||||
global.vuexCopy = null;
|
||||
// 同步 vuex 状态,由于 player 有循环引用问题,拷贝部分属性
|
||||
ipcMain.on("vuex-state", (e, state) => {
|
||||
global.vuexCopy = state;
|
||||
});
|
||||
|
||||
ipcMain.on("close", () => {
|
||||
win.close();
|
||||
app.quit();
|
||||
});
|
||||
|
||||
ipcMain.on("minimize", () => {
|
||||
win.minimize();
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue