Function
findTeammateColor
(
appState: {
teamContext?: { teammates: { [id: string]: { color?: string } } }
},
name: string,
)
Source from the content-addressed store, hash-verified
| 131 | | ResponseOutput |
| 132 | |
| 133 | function findTeammateColor( |
| 134 | appState: { |
| 135 | teamContext?: { teammates: { [id: string]: { color?: string } } } |
| 136 | }, |
| 137 | name: string, |
| 138 | ): string | undefined { |
| 139 | const teammates = appState.teamContext?.teammates |
| 140 | if (!teammates) return undefined |
| 141 | for (const teammate of Object.values(teammates)) { |
| 142 | if ('name' in teammate && (teammate as { name: string }).name === name) { |
| 143 | return teammate.color |
| 144 | } |
| 145 | } |
| 146 | return undefined |
| 147 | } |
| 148 | |
| 149 | async function handleMessage( |
| 150 | recipientName: string, |
Tested by
no test coverage detected