diff options
Diffstat (limited to 'recipes/chatwork')
-rw-r--r-- | recipes/chatwork/package.json | 2 | ||||
-rw-r--r-- | recipes/chatwork/webview.js | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/recipes/chatwork/package.json b/recipes/chatwork/package.json index eb6eaf8..52cbf02 100644 --- a/recipes/chatwork/package.json +++ b/recipes/chatwork/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "chatwork", | 2 | "id": "chatwork", |
3 | "name": "ChatWork", | 3 | "name": "ChatWork", |
4 | "version": "1.1.0", | 4 | "version": "1.1.1", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "repository": "https://github.com/hideosasaki/recipe-chatwork", | 6 | "repository": "https://github.com/hideosasaki/recipe-chatwork", |
7 | "config": { | 7 | "config": { |
diff --git a/recipes/chatwork/webview.js b/recipes/chatwork/webview.js index e131093..cc40834 100644 --- a/recipes/chatwork/webview.js +++ b/recipes/chatwork/webview.js | |||
@@ -1,7 +1,5 @@ | |||
1 | module.exports = (Ferdi) => { | 1 | module.exports = (Ferdi) => { |
2 | function getMessages() { | 2 | function getMessages() { |
3 | let groupCount = 0; | ||
4 | let individualCount = 0; | ||
5 | let directCount = 0; | 3 | let directCount = 0; |
6 | let indirectCount = 0; | 4 | let indirectCount = 0; |
7 | const roomInfoContainer = document.querySelectorAll('li.sc-dnqmqq'); | 5 | const roomInfoContainer = document.querySelectorAll('li.sc-dnqmqq'); |
@@ -11,20 +9,17 @@ module.exports = (Ferdi) => { | |||
11 | const unreadBadgeHasMention = room.querySelector('li._unreadBadge.sc-cSHVUG'); | 9 | const unreadBadgeHasMention = room.querySelector('li._unreadBadge.sc-cSHVUG'); |
12 | 10 | ||
13 | if (unreadBadge && unreadBadge.innerText) { | 11 | if (unreadBadge && unreadBadge.innerText) { |
14 | count = parseInt(unreadBadge.innerText); | 12 | count = Ferdi.safeParseInt(unreadBadge.innerText); |
15 | } | 13 | } |
16 | 14 | ||
17 | if (count > 0) { | 15 | if (count > 0) { |
18 | if (room.querySelector('img.sc-gqjmRU').getAttribute('src').indexOf('avatar') < 0) { | 16 | if (room.querySelector('img.sc-gqjmRU').getAttribute('src').indexOf('avatar') < 0) { |
19 | groupCount += count; | ||
20 | |||
21 | if (unreadBadgeHasMention) { | 17 | if (unreadBadgeHasMention) { |
22 | directCount++; | 18 | directCount++; |
23 | } else { | 19 | } else { |
24 | indirectCount++; | 20 | indirectCount++; |
25 | } | 21 | } |
26 | } else { | 22 | } else { |
27 | individualCount += count; | ||
28 | directCount++; | 23 | directCount++; |
29 | } | 24 | } |
30 | } | 25 | } |