aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/wrike/webview.js
blob: 93d5d531572e7812c1b913f49adbedeafea08723 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module.exports = Ferdi => {
  const getMessages = () => {
    let directCount = 0;
    const element = document.querySelector(
      '.ws-navigation-button__indicator.ws-navigation-button-indicator',
    );
    if (element) {
      directCount = Ferdi.safeParseInt(element.textContent);
    }

    Ferdi.setBadge(directCount);
  };

  Ferdi.loop(getMessages);
};