aboutsummaryrefslogtreecommitdiffstats
path: root/uncompressed/hackmd/webview.js
blob: 19779530a26b0a5b9c765b1ccdcfc5a0fd0d6923 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const path = require("path");

module.exports = (Franz) => {
  const getMessages = function getMessages() {
    // get unread messages
    const count = document.querySelectorAll('.guilds-wrapper .badge').length;

    // set Franz badge
    Franz.setBadge(count);
  };

  // check for new messages every second and update Franz badge
  Franz.loop(getMessages);

  // Hide download message
  Franz.injectCSS(path.join(__dirname, 'service.css'));
};