From d3841b766f9d37d557646003899f67525c5f755f Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Tue, 5 Oct 2021 17:04:09 +0200 Subject: chore: add eslint-plugin-unicorn (#733) --- recipes/rocketchat/webview.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'recipes/rocketchat/webview.js') diff --git a/recipes/rocketchat/webview.js b/recipes/rocketchat/webview.js index 5ed7866..95ada6f 100644 --- a/recipes/rocketchat/webview.js +++ b/recipes/rocketchat/webview.js @@ -33,17 +33,17 @@ module.exports = Ferdi => { const xmlhttp = new XMLHttpRequest(); - xmlhttp.onreadystatechange = function () { + xmlhttp.addEventListener('readystatechange', function () { if (this.readyState != 4 || this.status != 200) { return; } const response = JSON.parse(this.responseText); - if (response.icons.length >= 1) { + if (response.icons.length > 0) { Ferdi.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`); } - }; + }); xmlhttp.open('GET', manifestUrl, true); xmlhttp.send(); -- cgit v1.2.3-70-g09d2