Skip to content

Commit

Permalink
fix(GroupedGoalList): Create Goal mirage
Browse files Browse the repository at this point in the history
  • Loading branch information
LamaEats committed Oct 18, 2023
1 parent 2d5d147 commit a85d69d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/CollapsableItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const CollapsableItem: FC<React.PropsWithChildren<CollapsableItemProps>>
{nullable(children, (ch) => (
<StyledCollapsableItem>{ch}</StyledCollapsableItem>
))}
{!collapsed ? content : null}
{nullable(content, (c) => !collapsed && c)}
</StyledCollapsableContainer>
);
};
9 changes: 5 additions & 4 deletions src/components/ProjectListItemConnected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ProjectListItemConnected: FC<{
const { on } = useGoalPreview();
const utils = trpc.useContext();

const { data: projectDeepInfo } = trpc.project.getDeepInfo.useQuery(
const { data: projectDeepInfo, isLoading: isDeepInfoLoading } = trpc.project.getDeepInfo.useQuery(
{
id: project.id,
goalsQuery: queryState,
Expand Down Expand Up @@ -120,9 +120,10 @@ export const ProjectListItemConnected: FC<{
deep={deep}
contentHidden={contentHidden}
>
{nullable(!projectDeepInfo?.goals.length && status !== 'loading', () => (
<InlineCreateGoalControl projectId={project.id} />
))}
{nullable(
!projectDeepInfo?.goals.length,
() => !isDeepInfoLoading && <InlineCreateGoalControl projectId={project.id} />,
)}
{childrenProjects.map((p) => (
<ProjectListItemConnected
key={p.id}
Expand Down

0 comments on commit a85d69d

Please sign in to comment.