From 67f193af924fcebacf59a99bb18ea8ab17718900 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Fri, 15 Nov 2019 16:34:27 +0100 Subject: Update GMail recipe --- uncompressed/gmail/index.js | 5 ++--- uncompressed/gmail/package.json | 2 +- uncompressed/gmail/service.css | 3 +++ uncompressed/gmail/webview.js | 11 +++++++---- 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 uncompressed/gmail/service.css (limited to 'uncompressed') diff --git a/uncompressed/gmail/index.js b/uncompressed/gmail/index.js index e8243fb..46f936f 100644 --- a/uncompressed/gmail/index.js +++ b/uncompressed/gmail/index.js @@ -1,3 +1,2 @@ -"use strict"; - -module.exports = Franz => Franz; \ No newline at end of file +// just pass through Franz +module.exports = Franz => Franz; diff --git a/uncompressed/gmail/package.json b/uncompressed/gmail/package.json index 9af00ed..7546d19 100644 --- a/uncompressed/gmail/package.json +++ b/uncompressed/gmail/package.json @@ -1,7 +1,7 @@ { "id": "gmail", "name": "Gmail", - "version": "1.1.1", + "version": "1.2.0", "description": "Gmail", "main": "index.js", "author": "Stefan Malzner ", diff --git a/uncompressed/gmail/service.css b/uncompressed/gmail/service.css new file mode 100644 index 0000000..1af9dfd --- /dev/null +++ b/uncompressed/gmail/service.css @@ -0,0 +1,3 @@ +.UC.bAp.cd .vh { + display: none !important; +} \ No newline at end of file diff --git a/uncompressed/gmail/webview.js b/uncompressed/gmail/webview.js index 521d4ad..febf64b 100644 --- a/uncompressed/gmail/webview.js +++ b/uncompressed/gmail/webview.js @@ -1,6 +1,6 @@ -"use strict"; +import path from 'path'; -module.exports = Franz => { +module.exports = (Franz) => { const getMessages = function getMessages() { let count = 0; @@ -10,14 +10,17 @@ module.exports = Franz => { } } + // Just incase we don't end up with a number, set it back to zero (parseInt can return NaN) count = parseInt(count, 10); - if (isNaN(count)) { count = 0; } + // set Franz badge Franz.setBadge(count); }; + Franz.injectCSS(path.join(__dirname, 'service.css')); + // check for new messages every second and update Franz badge Franz.loop(getMessages); -}; \ No newline at end of file +}; -- cgit v1.2.3-70-g09d2