@zeniai/client-epic-state 4.20.0-beta15RR → 4.20.0-beta16RR

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,11 +62,14 @@ const getTasksWithUserDetails = ({ taskListState, taskState, userState, userRole
62
62
  .map((userId) => getUserAndUserRole(userState, userRoleState, addressState, userId))
63
63
  .filter((value) => value != null);
64
64
  // Compute sort name matching display order: groups first, then users
65
- const firstGroupName = task.groupAssignees
66
- .map((gId) => userGroupsState.userGroupByUserGroupId[gId]?.name ?? '')
67
- .find((name) => name !== '');
68
- const firstUserName = getUserName(assigneeUsers[0]?.user);
69
- const firstAssigneeSortName = (firstGroupName ?? firstUserName ?? '').toLowerCase();
65
+ const firstGroupName = task.groupAssignees.length > 0
66
+ ? task.groupAssignees
67
+ .map((gId) => userGroupsState.userGroupByUserGroupId[gId]?.name ?? '')
68
+ .find((name) => name !== '')
69
+ : undefined;
70
+ const firstUser = assigneeUsers[0]?.user;
71
+ const firstUserName = getUserName(firstUser) || firstUser?.email || '';
72
+ const firstAssigneeSortName = (firstGroupName ?? firstUserName).toLowerCase();
70
73
  return { ...task, assigneeUsers, firstAssigneeSortName };
71
74
  }
72
75
  return undefined;