aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/nextcloud/webview.js
blob: 4a90bb1e771d76a84c08bee40e1b3e0c1fc69ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const _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(
      '.notifications .notification-container .notification-wrapper li .notification',
    ).length;

    Franz.setBadge(direct);
  };

  Franz.loop(getMessages);
};