mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-07 17:28:53 +00:00
fix(app): restore sidebar dash and sync session spinner colors (#17384)
This commit is contained in:
@@ -9,3 +9,15 @@ export function agentColor(name: string, custom?: string) {
|
||||
if (custom) return custom
|
||||
return defaults[name] ?? defaults[name.toLowerCase()]
|
||||
}
|
||||
|
||||
export function messageAgentColor(
|
||||
list: readonly { role: string; agent?: string }[] | undefined,
|
||||
agents: readonly { name: string; color?: string }[],
|
||||
) {
|
||||
if (!list) return undefined
|
||||
for (let i = list.length - 1; i >= 0; i--) {
|
||||
const item = list[i]
|
||||
if (item.role !== "user" || !item.agent) continue
|
||||
return agentColor(item.agent, agents.find((agent) => agent.name === item.agent)?.color)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user