aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/rocketchat/webview.js
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/rocketchat/webview.js')
-rw-r--r--recipes/rocketchat/webview.js6
1 files changed, 3 insertions, 3 deletions
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 => {
33 33
34 const xmlhttp = new XMLHttpRequest(); 34 const xmlhttp = new XMLHttpRequest();
35 35
36 xmlhttp.onreadystatechange = function () { 36 xmlhttp.addEventListener('readystatechange', function () {
37 if (this.readyState != 4 || this.status != 200) { 37 if (this.readyState != 4 || this.status != 200) {
38 return; 38 return;
39 } 39 }
40 40
41 const response = JSON.parse(this.responseText); 41 const response = JSON.parse(this.responseText);
42 42
43 if (response.icons.length >= 1) { 43 if (response.icons.length > 0) {
44 Ferdi.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`); 44 Ferdi.setAvatarImage(`${window.location.protocol}//${window.location.host}${response.icons[0].src}`);
45 } 45 }
46 }; 46 });
47 47
48 xmlhttp.open('GET', manifestUrl, true); 48 xmlhttp.open('GET', manifestUrl, true);
49 xmlhttp.send(); 49 xmlhttp.send();