aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/workplace/webview.js
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-27 18:13:24 +0530
committerLibravatar GitHub <noreply@github.com>2021-08-27 18:13:24 +0530
commit155c4b832281348c16be1f4ef667e6e23dbf1bd8 (patch)
treed144e2de2e6c7fb2e334246e8a4aecdbeb08ef8d /recipes/workplace/webview.js
parentdocs: fixed template file for creating recipe. (diff)
downloadferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.gz
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.tar.zst
ferdium-recipes-155c4b832281348c16be1f4ef667e6e23dbf1bd8.zip
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.
Diffstat (limited to 'recipes/workplace/webview.js')
-rw-r--r--recipes/workplace/webview.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/recipes/workplace/webview.js b/recipes/workplace/webview.js
index af2af89..e10c449 100644
--- a/recipes/workplace/webview.js
+++ b/recipes/workplace/webview.js
@@ -1,6 +1,8 @@
1const path = require('path'); 1const _path = _interopRequireDefault(require('path'));
2 2
3module.exports = Franz => { 3function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4
5module.exports = Ferdi => {
4 const getMessages = () => { 6 const getMessages = () => {
5 let direct = 0; 7 let direct = 0;
6 let indirect = 0; 8 let indirect = 0;
@@ -23,18 +25,20 @@ module.exports = Franz => {
23 } 25 }
24 } 26 }
25 27
26 Franz.setBadge(direct, indirect); 28 Ferdi.setBadge(direct, indirect);
27 }; 29 };
28 30
29 Franz.injectCSS(path.join(__dirname, 'workplace.css')); 31 Ferdi.loop(getMessages);
30 Franz.loop(getMessages); 32
33 Ferdi.injectCSS(_path.default.join(__dirname, 'workplace.css'));
34
31 localStorage._cs_desktopNotifsEnabled = JSON.stringify({ 35 localStorage._cs_desktopNotifsEnabled = JSON.stringify({
32 __t: new Date().getTime(), 36 __t: new Date().getTime(),
33 __v: true, 37 __v: true,
34 }); 38 });
35 39
36 if (typeof Franz.onNotify === 'function') { 40 if (typeof Ferdi.onNotify === 'function') {
37 Franz.onNotify(notification => { 41 Ferdi.onNotify(notification => {
38 if (typeof notification.title !== 'string') { 42 if (typeof notification.title !== 'string') {
39 notification.title = ((notification.title.props || {}).content || [])[0] || 'Work Chat'; 43 notification.title = ((notification.title.props || {}).content || [])[0] || 'Work Chat';
40 } 44 }