Failure on multiple clients #1

Closed
opened 2025-10-12 23:44:25 +00:00 by franpcode · 1 comment
Owner

Originally created by @kolesar-andras on GitHub.

I have two Clockify workspaces. When I select one of them, project list does not load. Another workspace loads fine.

Javascript console shows an error at ClockifyTaskForm.jsx:135:20:

TypeError: s.clients[e.clientName] is undefined

Related code:

if (!data.clients) {
    data.clients = {[project.clientName]: [project]}
} else {
    data.clients[project.clientName].push(project)
}

Workspace having more than one client causes the bug. Another workspace has only one client.

Code creates only one key in the data.clients object, for the first clientName in the order of JSON input. Second name cannot be found in this object.

Originally created by @kolesar-andras on GitHub. I have two Clockify workspaces. When I select one of them, project list does not load. Another workspace loads fine. Javascript console shows an error at `ClockifyTaskForm.jsx:135:20`: ``` TypeError: s.clients[e.clientName] is undefined ``` Related code: ```javascript if (!data.clients) { data.clients = {[project.clientName]: [project]} } else { data.clients[project.clientName].push(project) } ``` Workspace having more than one client causes the bug. Another workspace has only one client. Code creates only one key in the `data.clients` object, for the first `clientName` in the order of JSON input. Second name cannot be found in this object.
Author
Owner

@FranP-code commented on GitHub:

Hello @kolesar-andras! Thank you for report this bug.

Merged the solution with this branch: https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration/pull/2

@FranP-code commented on GitHub: Hello @kolesar-andras! Thank you for report this bug. Merged the solution with this branch: https://github.com/FranP-code/Pomodoro-Timer-with-Clockify-integration/pull/2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: franpcode/Pomodoro-Timer-with-Clockify-integration#1
No description provided.