From efac88db4c7c674638eaa3d8b62f3ff831463f2d Mon Sep 17 00:00:00 2001 From: kPherox Date: Sun, 14 Apr 2019 01:32:16 +0900 Subject: [PATCH] Change to pass error on itunes-np --- app/js/ui/spotify.js | 4 ++++ app/main/np.js | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index a9bd9659..b40c46b5 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -129,6 +129,10 @@ function nowplaying(mode){ ipc.send('itunes', ""); ipc.once('itunes-np', function (event, arg) { + if (arg.cmd) { + console.error(arg); + return; + } console.log(arg); var content=localStorage.getItem("np-temp"); if(!content || content=="" || content=="null"){ diff --git a/app/main/np.js b/app/main/np.js index 31ad140b..352add5f 100644 --- a/app/main/np.js +++ b/app/main/np.js @@ -29,8 +29,9 @@ function np(mainWindow){ nowplaying.getRawData().then(function (value) { mainWindow.webContents.send('itunes-np', value); }).catch(function (error) { - // 非同期処理失敗。呼ばれない - console.log(error); + // エラーを返す + console.error(error); + mainWindow.webContents.send('itunes-np', error); }); }else{ var {NowPlaying,PlayerName} = require("nowplaying-node");