Function
findTeammateColor
(
appState: {
teamContext?: { teammates: { [id: string]: { color?: string } } }
},
name: string,
)
Source from the content-addressed store, hash-verified
| 177 | | ResponseOutput |
| 178 | |
| 179 | function findTeammateColor( |
| 180 | appState: { |
| 181 | teamContext?: { teammates: { [id: string]: { color?: string } } } |
| 182 | }, |
| 183 | name: string, |
| 184 | ): string | undefined { |
| 185 | const teammates = appState.teamContext?.teammates |
| 186 | if (!teammates) return undefined |
| 187 | for (const teammate of Object.values(teammates)) { |
| 188 | if ('name' in teammate && (teammate as { name: string }).name === name) { |
| 189 | return teammate.color |
| 190 | } |
| 191 | } |
| 192 | return undefined |
| 193 | } |
| 194 | |
| 195 | async function handleMessage( |
| 196 | recipientName: string, |
Tested by
no test coverage detected