MCPcopy Create free account
hub / github.com/coder/coder / includeAuthenticatedUser

Function includeAuthenticatedUser

site/src/pages/TasksPage/UsersCombobox.tsx:145–153  ·  view source on GitHub ↗
(users: readonly User[])

Source from the content-addressed store, hash-verified

143 selectedValue: string,
144): UserOption[] {
145 const includeAuthenticatedUser = (users: readonly User[]) => {
146 const hasAuthenticatedUser = users.some(
147 (u) => u.username === authUser.username,
148 );
149 if (hasAuthenticatedUser) {
150 return users;
151 }
152 return [authUser, ...users];
153 };
154
155 const sortSelectedFirst = (a: User) =>
156 selectedValue && a.username === selectedValue ? -1 : 0;

Callers 1

mapUsersToOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected