From 97697e3d069972844b2912a93022f4a4904a40d6 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sat, 31 Jul 2021 15:28:23 +0530 Subject: Fixed eslintrc as root for this folder; Reformatted all files. --- recipes/chatwork/index.js | 4 +--- recipes/chatwork/webview.js | 16 +++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'recipes/chatwork') diff --git a/recipes/chatwork/index.js b/recipes/chatwork/index.js index a409287..258da41 100644 --- a/recipes/chatwork/index.js +++ b/recipes/chatwork/index.js @@ -1,3 +1 @@ -'use strict'; - -module.exports = Franz => Franz; \ No newline at end of file +module.exports = Franz => Franz; diff --git a/recipes/chatwork/webview.js b/recipes/chatwork/webview.js index 48a3fbf..c6465ec 100644 --- a/recipes/chatwork/webview.js +++ b/recipes/chatwork/webview.js @@ -1,23 +1,21 @@ -'use strict'; - module.exports = (Franz, options) => { function getMessages() { let groupCount = 0; let individualCount = 0; let directCount = 0; let indirectCount = 0; - let roomInfoContainer = document.querySelectorAll('li.sc-dnqmqq'); - Array.prototype.forEach.call(roomInfoContainer, function (room) { + const roomInfoContainer = document.querySelectorAll('li.sc-dnqmqq'); + Array.prototype.forEach.call(roomInfoContainer, (room) => { let count = 0; - let unreadBadge = room.querySelector("span.sc-kAzzGY"); - let unreadBadgeHasMention = room.querySelector("li._unreadBadge.sc-cSHVUG"); + const unreadBadge = room.querySelector('span.sc-kAzzGY'); + const unreadBadgeHasMention = room.querySelector('li._unreadBadge.sc-cSHVUG'); if (unreadBadge && unreadBadge.innerText) { count = parseInt(unreadBadge.innerText); } - if (0 < count) { - if (room.querySelector("img.sc-gqjmRU").getAttribute('src').indexOf('avatar') < 0) { + if (count > 0) { + if (room.querySelector('img.sc-gqjmRU').getAttribute('src').indexOf('avatar') < 0) { groupCount += count; if (unreadBadgeHasMention) { @@ -35,4 +33,4 @@ module.exports = (Franz, options) => { } Franz.loop(getMessages); -}; \ No newline at end of file +}; -- cgit v1.2.3-70-g09d2