aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud-talk/webview.js
blob: c180d4d07e5693b7afe379c3fcea032c75ff030b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"use strict";

var _path = _interopRequireDefault(require("path"));

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

module.exports = Franz => {
  const getMessages = function getMessages() {
    const direct = document.querySelectorAll('.app-navigation-entry-utils-counter.highlighted').length;
    const indirect = document.querySelectorAll('.app-navigation-entry-utils-counter:not(.highlighted)').length;
    Franz.setBadge(direct, indirect);
  };

  Franz.loop(getMessages);
  Franz.injectCSS(_path.default.join(__dirname, 'service.css'));
};