mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 05:29:53 +00:00
app: include sandboxes in project unseen/error notifs
This commit is contained in:
parent
b0ceec9b19
commit
94feb811ca
1 changed files with 5 additions and 2 deletions
|
|
@ -21,8 +21,11 @@ const OPENCODE_PROJECT_ID = "4b0ea68d7af9a6031a7ffda7ad66e0cb83315750"
|
||||||
|
|
||||||
export const ProjectIcon = (props: { project: LocalProject; class?: string; notify?: boolean }): JSX.Element => {
|
export const ProjectIcon = (props: { project: LocalProject; class?: string; notify?: boolean }): JSX.Element => {
|
||||||
const notification = useNotification()
|
const notification = useNotification()
|
||||||
const unseenCount = createMemo(() => notification.project.unseenCount(props.project.worktree))
|
const dirs = createMemo(() => [props.project.worktree, ...(props.project.sandboxes ?? [])])
|
||||||
const hasError = createMemo(() => notification.project.unseenHasError(props.project.worktree))
|
const unseenCount = createMemo(() =>
|
||||||
|
dirs().reduce((total, directory) => total + notification.project.unseenCount(directory), 0),
|
||||||
|
)
|
||||||
|
const hasError = createMemo(() => dirs().some((directory) => notification.project.unseenHasError(directory)))
|
||||||
const name = createMemo(() => props.project.name || getFilename(props.project.worktree))
|
const name = createMemo(() => props.project.name || getFilename(props.project.worktree))
|
||||||
return (
|
return (
|
||||||
<div class={`relative size-8 shrink-0 rounded ${props.class ?? ""}`}>
|
<div class={`relative size-8 shrink-0 rounded ${props.class ?? ""}`}>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue