Skip to content

Commit

Permalink
Song provider: call callbacks when data is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
th-ch committed Mar 29, 2021
1 parent 05eee7c commit ebe8755
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions providers/song-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit ebe8755

Please sign in to comment.