Skip to content

Commit 2f9fa1c

Browse files
fix: module crash when there are no clients (#8)
* fix: module crashing with no clients * chore: version bump * chore: format
1 parent 0e8d7ff commit 2f9fa1c

6 files changed

Lines changed: 2178 additions & 10 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: [daniep01,krombel] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: [daniep01, krombel] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username

companion/HELP.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ Presets are available for **Start Timer** and **Stop Timer**.
6464

6565
### Version 2.1.0
6666

67-
- rewrite module in typescript
68-
- use module toggl-track instead of implementing api on our own
69-
- add status reports for some failure cases in connections dashboard
70-
- add configurable time entry poller
71-
- add feedback for currently running project and client
72-
- update timerDuration to contain the correct duration formatted as time string
67+
- Rewrite module in typescript
68+
- Use module toggl-track instead of implementing api on our own
69+
- Add status reports for some failure cases in connections dashboard
70+
- Add configurable time entry poller
71+
- Add feedback for currently running project and client
72+
- Update timerDuration to contain the correct duration formatted as time string
73+
74+
### Version 2.1.1
75+
76+
- Prevent module crash if user has no Clients

companion/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "toggl-track",
44
"shortname": "toggl-track",
55
"description": "Companion module for toggltrack timers",
6-
"version": "2.0.1",
6+
"version": "0.0.0",
77
"license": "MIT",
88
"repository": "git+https://github.com/bitfocus/companion-module-toggl-track.git",
99
"bugs": "https://github.com/bitfocus/companion-module-toggl-track/issues",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "toggl-track",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"main": "dist/main.js",
55
"type": "module",
66
"scripts": {

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class TogglTrack extends InstanceBase<ModuleConfig> {
167167
timerDuration: timecodeSince(new Date(entry.start)),
168168
timerProject: project?.label,
169169
timerProjectID: entry.project_id,
170-
timerClient: this.clients!.find((c) => c.id == project?.clientID)?.label,
170+
timerClient: this.clients?.find((c) => c.id == project?.clientID)?.label ?? 'None',
171171
timerClientID: project?.clientID,
172172
})
173173

0 commit comments

Comments
 (0)