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/index.js | 4 ++-- recipes/rocketchat/webview.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'recipes/rocketchat') diff --git a/recipes/rocketchat/index.js b/recipes/rocketchat/index.js index 062b5ec..97de4fe 100644 --- a/recipes/rocketchat/index.js +++ b/recipes/rocketchat/index.js @@ -9,8 +9,8 @@ module.exports = Ferdi => class RocketChat extends Ferdi { }); const status = resp.status.toString(); return status.startsWith('2') || status.startsWith('3'); - } catch (err) { - console.error(err); + } catch (error) { + console.error(error); } return false; 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