Fix: #108 NowPlaying of iTunes on macOS

This commit is contained in:
Cutls 2019-08-23 02:00:22 +09:00
parent d0ed9faf50
commit 61d4d7005e
2 changed files with 5 additions and 7 deletions

View File

@ -45,12 +45,8 @@ onmessage = function (e) {
} else if (e.data[0] == "aboutData") {
ipc.send('aboutData', "");
} else if (e.data[0] == "itunes") {
console.log("NowPlaying" + ipc.listenerCount('itunes-np'))
if (ipc.listenerCount('itunes-np') > 1) {
return false;
} else {
console.log("NowPlaying")
ipc.send("itunes", e.data[1])
}
} else if (e.data[0] == "themeCSSRequest") {
ipc.send('theme-css-request', e.data[1]);
} else if (e.data[0] == "downloadButton") {
@ -148,7 +144,7 @@ ipc.on('theme-json-create-complete', function (event, args) {
postMessage(["ctLoad", ""], "*")
});
//spotify.js
ipc.once('itunes-np', function (event, arg) {
ipc.on('itunes-np', function (event, arg) {
postMessage(["npCore", arg], "*")
})
//tips.js

View File

@ -22,6 +22,8 @@ function np(mainWindow) {
console.error(error);
e.sender.webContents.send('itunes-np', error);
}
} else {
}
}