|
|
@ -1,5 +1,7 @@
|
|
|
|
import { app, ipcMain, dialog } from "electron";
|
|
|
|
import { app, dialog, globalShortcut, ipcMain } from "electron";
|
|
|
|
import match from "@njzy/unblockneteasemusic";
|
|
|
|
import match from "@njzy/unblockneteasemusic";
|
|
|
|
|
|
|
|
import { registerGlobalShortcut } from "@/electron/globalShortcut";
|
|
|
|
|
|
|
|
|
|
|
|
const client = require("discord-rich-presence")("818936529484906596");
|
|
|
|
const client = require("discord-rich-presence")("818936529484906596");
|
|
|
|
|
|
|
|
|
|
|
|
export function initIpcMain(win, store) {
|
|
|
|
export function initIpcMain(win, store) {
|
|
|
@ -61,6 +63,14 @@ export function initIpcMain(win, store) {
|
|
|
|
|
|
|
|
|
|
|
|
ipcMain.on("settings", (event, options) => {
|
|
|
|
ipcMain.on("settings", (event, options) => {
|
|
|
|
store.set("settings", options);
|
|
|
|
store.set("settings", options);
|
|
|
|
|
|
|
|
const isRegisterShortcut = globalShortcut.isRegistered(
|
|
|
|
|
|
|
|
"Alt+CommandOrControl+P"
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (options.enableGlobalShortcut) {
|
|
|
|
|
|
|
|
!isRegisterShortcut && registerGlobalShortcut(win);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
isRegisterShortcut && globalShortcut.unregisterAll();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
ipcMain.on("playDiscordPresence", (event, track) => {
|
|
|
|
ipcMain.on("playDiscordPresence", (event, track) => {
|
|
|
|