diff options
Diffstat (limited to 'recipes/toggl')
-rw-r--r-- | recipes/toggl/package.json | 2 | ||||
-rw-r--r-- | recipes/toggl/webview-unsafe.js | 6 | ||||
-rw-r--r-- | recipes/toggl/webview.js | 14 |
3 files changed, 13 insertions, 9 deletions
diff --git a/recipes/toggl/package.json b/recipes/toggl/package.json index 327a91d..76297b1 100644 --- a/recipes/toggl/package.json +++ b/recipes/toggl/package.json | |||
@@ -1,7 +1,7 @@ | |||
1 | { | 1 | { |
2 | "id": "toggl", | 2 | "id": "toggl", |
3 | "name": "Toggl", | 3 | "name": "Toggl", |
4 | "version": "1.3.0", | 4 | "version": "1.4.0", |
5 | "license": "MIT", | 5 | "license": "MIT", |
6 | "config": { | 6 | "config": { |
7 | "serviceURL": "https://www.toggl.com/app/timer", | 7 | "serviceURL": "https://www.toggl.com/app/timer", |
diff --git a/recipes/toggl/webview-unsafe.js b/recipes/toggl/webview-unsafe.js index f657e0c..3e39e3e 100644 --- a/recipes/toggl/webview-unsafe.js +++ b/recipes/toggl/webview-unsafe.js | |||
@@ -1,6 +1,8 @@ | |||
1 | // only try to update badge once Ferdium API has finished loading | 1 | // only try to update badge once Ferdium API has finished loading |
2 | if (window.ferdium != undefined && window.ferdium.setBadge != undefined) { | 2 | if (window.ferdium !== undefined && window.ferdium.setBadge !== undefined) { |
3 | var timerRunning = (window.toggl != undefined) && !!(window.toggl.store.getState().view.timer.timeEntry.start); | 3 | const timerRunning = |
4 | window.toggl !== undefined && | ||
5 | !!window.toggl.store.getState().view.timer.timeEntry.start; | ||
4 | 6 | ||
5 | // Treat running timer as a "non-direct" notification (default blue dot instead of urgent red "1") | 7 | // Treat running timer as a "non-direct" notification (default blue dot instead of urgent red "1") |
6 | window.ferdium.setBadge(0, timerRunning ? 1 : 0); | 8 | window.ferdium.setBadge(0, timerRunning ? 1 : 0); |
diff --git a/recipes/toggl/webview.js b/recipes/toggl/webview.js index 39ac3c3..22d5a66 100644 --- a/recipes/toggl/webview.js +++ b/recipes/toggl/webview.js | |||
@@ -1,11 +1,13 @@ | |||
1 | const _path = _interopRequireDefault(require('path')); | 1 | function _interopRequireDefault(obj) { |
2 | return obj && obj.__esModule ? obj : { default: obj }; | ||
3 | } | ||
2 | 4 | ||
3 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | 5 | const _path = _interopRequireDefault(require('path')); |
4 | 6 | ||
5 | module.exports = Ferdium => { | 7 | module.exports = Ferdium => { |
6 | const updateBadge = function updateBadge() { | 8 | const updateBadge = function updateBadge() { |
7 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); | 9 | Ferdium.injectJSUnsafe(_path.default.join(__dirname, 'webview-unsafe.js')); |
8 | }; | 10 | }; |
9 | 11 | ||
10 | Ferdium.loop(updateBadge); | 12 | Ferdium.loop(updateBadge); |
11 | }; | 13 | }; |