ferdi icon indicating copy to clipboard operation
ferdi copied to clipboard

[Bug]: unread message badge broken in Zulip

Open delahondes opened this issue 3 years ago • 0 comments

Preflight Checklist

Ferdi Version

5.8.1

Recipe Name

zulip

Recipe Version

latest

Last Known working version of the recipe

It did work but a Zulip upgrade broke it

Steps to reproduce

  1. Add a zulip service
  2. have some unread message showing in zulip
  3. No unread badge appear

Expected Behavior

Unread messages badge should show

Actual Behavior

Unread messages do not show

Screenshots

No response

Additional Information

Actual JS recipe contain this in webview.js:

module.exports = Ferdi => {
  const getMessages = () => {
    const allMessages = Math.round(
      document.querySelectorAll(
        '#global_filters .top_left_all_messages .count .value',
      )[0].textContent,
    );
    Ferdi.setBadge(allMessages);
  };

  Ferdi.loop(getMessages);
};

Replacing with this restore functionality:

module.exports = Ferdi => {
  const getMessages = () => {
    const allMessages = Math.round(
      document.querySelectorAll(
        '#global_filters .top_left_all_messages',
      )[0].children[0].children[2].textContent
    );
    Ferdi.setBadge(allMessages);
  };

  Ferdi.loop(getMessages);
};

delahondes avatar Apr 02 '22 12:04 delahondes