From a98b8945fba9a1001624acdfb0cb4c74afb6ebb4 Mon Sep 17 00:00:00 2001 From: Araxeus Date: Thu, 6 May 2021 21:32:44 +0300 Subject: [PATCH] lint --- providers/song-controls-front.js | 2 +- providers/song-info-front.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/providers/song-controls-front.js b/providers/song-controls-front.js index c620203f..094d9a93 100644 --- a/providers/song-controls-front.js +++ b/providers/song-controls-front.js @@ -15,4 +15,4 @@ module.exports = () => { videoStream.yns_pause(); } }); -} \ No newline at end of file +}; diff --git a/providers/song-info-front.js b/providers/song-info-front.js index fbc98b99..fccc54a8 100644 --- a/providers/song-info-front.js +++ b/providers/song-info-front.js @@ -10,17 +10,16 @@ ipcRenderer.on("update-song-info", async (_, extractedSongInfo) => { }); const injectListener = () => { - var oldXHR = window.XMLHttpRequest; + const oldXHR = window.XMLHttpRequest; function newXHR() { - var realXHR = new oldXHR(); + const realXHR = new oldXHR(); realXHR.addEventListener( "readystatechange", () => { - if (realXHR.readyState == 4 && realXHR.status == 200) { - if (realXHR.responseURL.includes("/player")) { + if (realXHR.readyState === 4 && realXHR.status === 200 + && realXHR.responseURL.includes("/player")) { // if the request contains the song info, send the response to ipcMain ipcRenderer.send("song-info-request", realXHR.responseText); - } } }, false