From 155c4b832281348c16be1f4ef667e6e23dbf1bd8 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 27 Aug 2021 18:13:24 +0530 Subject: chore: normalized all recipes to ensure compatibility with es6 (#639) - Removed some calls to set badge with '0' all the time. - Removed all 'sourceMaps' since they are all outdated atm. --- recipes/podio/webview.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'recipes/podio/webview.js') diff --git a/recipes/podio/webview.js b/recipes/podio/webview.js index 2b1ed2a..1bfa60d 100644 --- a/recipes/podio/webview.js +++ b/recipes/podio/webview.js @@ -1,22 +1,14 @@ -const path = require('path'); +const _path = _interopRequireDefault(require('path')); -module.exports = (Franz, options) => { +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +module.exports = (Ferdi) => { const getMessages = () => { - // get unread messages const updates = document.getElementsByClassName('counter')[0].innerHTML; - - // get conversations in 'My Inbox' - // const inbox = document.getElementById('franz').getAttribute('data-inbox'); - - // set Franz badge - // updates => active unread count - // inbox => passive unread count - Franz.setBadge(updates, 0); + Ferdi.setBadge(updates, 0); }; - // inject franz.css stylesheet - Franz.injectCSS(path.join(__dirname, 'css', 'franz.css')); + Ferdi.loop(getMessages); - // check for new messages every second and update Franz badge - Franz.loop(getMessages); + Ferdi.injectCSS(_path.default.join(__dirname, 'css', 'franz.css')); }; -- cgit v1.2.3-70-g09d2