From ebe8755613e94000850877a786005ae172e51ec6 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 29 Mar 2021 21:59:45 +0200 Subject: [PATCH] Song provider: call callbacks when data is updated --- providers/song-info.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/providers/song-info.js b/providers/song-info.js index 55d87112..9a07ff28 100644 --- a/providers/song-info.js +++ b/providers/song-info.js @@ -79,10 +79,12 @@ const registerProvider = (win) => { }); // This will be called when the song-info-front finds a new request with song data - ipcMain.on( - "song-info-request", - async (_, responseText) => await handleData(responseText, win) - ); + ipcMain.on("song-info-request", async (_, responseText) => { + await handleData(responseText, win); + callbacks.forEach((c) => { + c(songInfo); + }); + }); return registerCallback; };