mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-09 19:52:44 +00:00
refactor(app): convert getProjectAvatarSource to early returns (#24896)
This commit is contained in:
parent
fc0e3c65b3
commit
f6b4f54216
1 changed files with 4 additions and 3 deletions
|
|
@ -20,9 +20,10 @@ import { childSessionOnPath, hasProjectPermissions } from "./helpers"
|
|||
const OPENCODE_PROJECT_ID = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"
|
||||
|
||||
export function getProjectAvatarSource(id?: string, icon?: { color?: string; url?: string; override?: string }) {
|
||||
return id === OPENCODE_PROJECT_ID
|
||||
? "https://opencode.ai/favicon.svg"
|
||||
: (icon?.override ?? (icon?.color ? undefined : icon?.url))
|
||||
if (id === OPENCODE_PROJECT_ID) return "https://opencode.ai/favicon.svg"
|
||||
if (icon?.override) return icon?.override
|
||||
if (icon?.color) return undefined
|
||||
return icon?.url
|
||||
}
|
||||
|
||||
export const ProjectIcon = (props: { project: LocalProject; class?: string; notify?: boolean }): JSX.Element => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue