Merge pull request #31 from tylerwince/codex/goal-detail-subgoals-render-fix
fix(ui): render sub-goals on goal detail pages
This commit is contained in:
@@ -92,7 +92,8 @@ function GoalNode({ goal, children, allGoals, depth, goalLink, onSelect }: GoalN
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function GoalTree({ goals, goalLink, onSelect }: GoalTreeProps) {
|
export function GoalTree({ goals, goalLink, onSelect }: GoalTreeProps) {
|
||||||
const roots = goals.filter((g) => !g.parentId);
|
const goalIds = new Set(goals.map((g) => g.id));
|
||||||
|
const roots = goals.filter((g) => !g.parentId || !goalIds.has(g.parentId));
|
||||||
|
|
||||||
if (goals.length === 0) {
|
if (goals.length === 0) {
|
||||||
return <p className="text-sm text-muted-foreground">No goals.</p>;
|
return <p className="text-sm text-muted-foreground">No goals.</p>;
|
||||||
|
|||||||
Reference in New Issue
Block a user