aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/rocketchat
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-07-31 15:28:23 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-07-31 15:28:23 +0530
commit97697e3d069972844b2912a93022f4a4904a40d6 (patch)
tree53faff30fbac9d72042f593dfe1c547809f4f121 /recipes/rocketchat
parentAllow any url in the custom-service to allow for sites like 'http://translate... (diff)
downloadferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.gz
ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.tar.zst
ferdium-recipes-97697e3d069972844b2912a93022f4a4904a40d6.zip
Fixed eslintrc as root for this folder; Reformatted all files.
Diffstat (limited to 'recipes/rocketchat')
-rw-r--r--recipes/rocketchat/index.js9
-rw-r--r--recipes/rocketchat/webview.js6
2 files changed, 5 insertions, 10 deletions
diff --git a/recipes/rocketchat/index.js b/recipes/rocketchat/index.js
index 54450ce..499053a 100644
--- a/recipes/rocketchat/index.js
+++ b/recipes/rocketchat/index.js
@@ -1,13 +1,11 @@
1"use strict";
2
3module.exports = Franz => class RocketChat extends Franz { 1module.exports = Franz => class RocketChat extends Franz {
4 async validateUrl(url) { 2 async validateUrl(url) {
5 try { 3 try {
6 const resp = await window.fetch(url, { 4 const resp = await window.fetch(url, {
7 method: 'GET', 5 method: 'GET',
8 headers: { 6 headers: {
9 'Content-Type': 'application/json' 7 'Content-Type': 'application/json',
10 } 8 },
11 }); 9 });
12 const status = resp.status.toString(); 10 const status = resp.status.toString();
13 return status.startsWith('2') || status.startsWith('3'); 11 return status.startsWith('2') || status.startsWith('3');
@@ -17,5 +15,4 @@ module.exports = Franz => class RocketChat extends Franz {
17 15
18 return false; 16 return false;
19 } 17 }
20 18};
21}; \ No newline at end of file
diff --git a/recipes/rocketchat/webview.js b/recipes/rocketchat/webview.js
index 447b19b..1702c74 100644
--- a/recipes/rocketchat/webview.js
+++ b/recipes/rocketchat/webview.js
@@ -1,5 +1,3 @@
1'use strict';
2
3const { ipcRenderer } = require('electron'); 1const { ipcRenderer } = require('electron');
4 2
5const getTeamIcon = function getTeamIcon() { 3const getTeamIcon = function getTeamIcon() {
@@ -27,7 +25,7 @@ const getTeamIcon = function getTeamIcon() {
27 if (response.icons.length >= 1) { 25 if (response.icons.length >= 1) {
28 ipcRenderer.sendToHost( 26 ipcRenderer.sendToHost(
29 'avatar', 27 'avatar',
30 `${window.location.protocol}//${window.location.host}${response.icons[0].src}` 28 `${window.location.protocol}//${window.location.host}${response.icons[0].src}`,
31 ); 29 );
32 } 30 }
33 }; 31 };
@@ -47,7 +45,7 @@ module.exports = Ferdi => {
47 } 45 }
48 46
49 const indirectMessagesCount = Math.round( 47 const indirectMessagesCount = Math.round(
50 document.querySelectorAll('.rcx-sidebar-item--highlighted').length 48 document.querySelectorAll('.rcx-sidebar-item--highlighted').length,
51 ); 49 );
52 50
53 Ferdi.setBadge(directMessagesCount, indirectMessagesCount); 51 Ferdi.setBadge(directMessagesCount, indirectMessagesCount);