diff options
Diffstat (limited to 'recipes/lark/webview.js')
-rw-r--r-- | recipes/lark/webview.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/recipes/lark/webview.js b/recipes/lark/webview.js index 4e3a614..dfccccf 100644 --- a/recipes/lark/webview.js +++ b/recipes/lark/webview.js | |||
@@ -1,15 +1,19 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | const _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 3 | function _interopRequireDefault(obj) { |
4 | return obj && obj.__esModule ? obj : { default: obj }; | ||
5 | } | ||
4 | 6 | ||
5 | module.exports = (Ferdi) => { | 7 | module.exports = Ferdi => { |
6 | const getMessages = () => { | 8 | const getMessages = () => { |
7 | const ele = document.querySelectorAll('.larkc-badge-count.navbarMenu-badge'); | 9 | const ele = document.querySelectorAll( |
8 | if (!ele.length) { | 10 | '.larkc-badge-count.navbarMenu-badge', |
11 | ); | ||
12 | if (ele.length === 0) { | ||
9 | Ferdi.setBadge(0); | 13 | Ferdi.setBadge(0); |
10 | return; | 14 | return; |
11 | } | 15 | } |
12 | Ferdi.setBadge(ele[0].innerHTML); | 16 | Ferdi.setBadge(ele[0].textContent); |
13 | }; | 17 | }; |
14 | 18 | ||
15 | Ferdi.loop(getMessages); | 19 | Ferdi.loop(getMessages); |