From 3464b0383cdb868e7d4979a482525a1d1a7ddcfd Mon Sep 17 00:00:00 2001 From: Sem Visscher Date: Thu, 18 Mar 2021 17:53:30 +0100 Subject: [PATCH] small readability changes --- providers/song-info-front.js | 7 ++++--- providers/song-info.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/providers/song-info-front.js b/providers/song-info-front.js index 5cd94a56..42c3afb2 100644 --- a/providers/song-info-front.js +++ b/providers/song-info-front.js @@ -4,18 +4,19 @@ const injectListener = () => { var oldXHR = window.XMLHttpRequest; function newXHR() { var realXHR = new oldXHR(); - realXHR.addEventListener("readystatechange", function() { + realXHR.addEventListener("readystatechange", () => { if(realXHR.readyState==4 && realXHR.status==200){ - if (realXHR.responseURL.includes('/player')) + if (realXHR.responseURL.includes('/player')){ // if the request is the contains the song info send the response to ipcMain ipcRenderer.send( "song-info-request", realXHR.responseText ); + } } }, false); return realXHR; } window.XMLHttpRequest = newXHR; } -module.exports = injectListener \ No newline at end of file +module.exports = injectListener; diff --git a/providers/song-info.js b/providers/song-info.js index 22f1a99c..067c5718 100644 --- a/providers/song-info.js +++ b/providers/song-info.js @@ -82,4 +82,4 @@ const registerProvider = (win) => { return registerCallback; }; -module.exports = registerProvider; \ No newline at end of file +module.exports = registerProvider;