diff options
Diffstat (limited to 'recipes/workplace')
-rw-r--r-- | recipes/workplace/index.js | 2 | ||||
-rw-r--r-- | recipes/workplace/package.json | 2 | ||||
-rw-r--r-- | recipes/workplace/webview.js | 18 |
3 files changed, 13 insertions, 9 deletions
diff --git a/recipes/workplace/index.js b/recipes/workplace/index.js index 258da41..23607bd 100644 --- a/recipes/workplace/index.js +++ b/recipes/workplace/index.js | |||
@@ -1 +1 @@ | |||
module.exports = Franz => Franz; | module.exports = Ferdi => Ferdi; | ||
diff --git a/recipes/workplace/package.json b/recipes/workplace/package.json index 5be0095..61e317c 100644 --- a/recipes/workplace/package.json +++ b/recipes/workplace/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "workplace", | 2 | "id": "workplace", |
3 | "name": "Workplace", | 3 | "name": "Workplace", |
4 | "version": "1.2.0", | 4 | "version": "1.3.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://{teamId}.workplace.com/chat", | 7 | "serviceURL": "https://{teamId}.workplace.com/chat", |
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 @@ | |||
1 | const path = require('path'); | 1 | const _path = _interopRequireDefault(require('path')); |
2 | 2 | ||
3 | module.exports = Franz => { | 3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
4 | |||
5 | module.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 | } |