fix: module crash when there are no clients (#8)

* fix: module crashing with no clients

* chore: version bump

* chore: format
This commit is contained in:
bryce
2025-09-14 14:16:26 -07:00
committed by GitHub
parent 0e8d7ffa32
commit 2f9fa1cb0b
6 changed files with 2178 additions and 10 deletions

View File

@@ -64,9 +64,13 @@ Presets are available for **Start Timer** and **Stop Timer**.
### Version 2.1.0 ### Version 2.1.0
- rewrite module in typescript - Rewrite module in typescript
- use module toggl-track instead of implementing api on our own - Use module toggl-track instead of implementing api on our own
- add status reports for some failure cases in connections dashboard - Add status reports for some failure cases in connections dashboard
- add configurable time entry poller - Add configurable time entry poller
- add feedback for currently running project and client - Add feedback for currently running project and client
- update timerDuration to contain the correct duration formatted as time string - Update timerDuration to contain the correct duration formatted as time string
### Version 2.1.1
- Prevent module crash if user has no Clients

View File

@@ -3,7 +3,7 @@
"name": "toggl-track", "name": "toggl-track",
"shortname": "toggl-track", "shortname": "toggl-track",
"description": "Companion module for toggltrack timers", "description": "Companion module for toggltrack timers",
"version": "2.0.1", "version": "0.0.0",
"license": "MIT", "license": "MIT",
"repository": "git+https://github.com/bitfocus/companion-module-toggl-track.git", "repository": "git+https://github.com/bitfocus/companion-module-toggl-track.git",
"bugs": "https://github.com/bitfocus/companion-module-toggl-track/issues", "bugs": "https://github.com/bitfocus/companion-module-toggl-track/issues",

View File

@@ -1,6 +1,6 @@
{ {
"name": "toggl-track", "name": "toggl-track",
"version": "2.1.0", "version": "2.1.1",
"main": "dist/main.js", "main": "dist/main.js",
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@@ -167,7 +167,7 @@ export class TogglTrack extends InstanceBase<ModuleConfig> {
timerDuration: timecodeSince(new Date(entry.start)), timerDuration: timecodeSince(new Date(entry.start)),
timerProject: project?.label, timerProject: project?.label,
timerProjectID: entry.project_id, timerProjectID: entry.project_id,
timerClient: this.clients!.find((c) => c.id == project?.clientID)?.label, timerClient: this.clients?.find((c) => c.id == project?.clientID)?.label ?? 'None',
timerClientID: project?.clientID, timerClientID: project?.clientID,
}) })

2164
yarn.lock Normal file

File diff suppressed because it is too large Load Diff