aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/riseup/webview.js
blob: 79b4a7bc92e587d6f3bdd33b3109bfceb8e4e2e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const _path = _interopRequireDefault(require('path'));

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

module.exports = Ferdi => {
  const getMessages = function getMessages() {
    let unread = 0;
    const notificationBadge = document.getElementsByClassName('unreadcount')[0];
    if (notificationBadge != undefined) {
      unread = notificationBadge.innerText;
    }
    Ferdi.setBadge(parseInt(unread, 10));
  };

  Ferdi.loop(getMessages);
};