aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/riseup/webview.js
blob: 705a0bad87469813249c9c8a662ff271d3831293 (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 = Ferdi => {
  const getMessages = function getMessages() {
    var unread = 0
    const notificationBadge = document.getElementsByClassName('unreadcount')[0]
    if (notificationBadge != undefined) {
        unread = notificationBadge.innerText;
    }
    Ferdi.setBadge(parseInt(unread, 10));
  };

  Ferdi.loop(getMessages);
};