Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui-home): load synthesis to get areas and links count #1911

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import DetailsList from "./DetailsList";
import { getAreas, getLinks } from "../../../../../../redux/selectors";
import UsePromiseCond from "../../../../../common/utils/UsePromiseCond";
import useAppSelector from "../../../../../../redux/hooks/useAppSelector";
import useStudySynthesis from "../../../../../../redux/hooks/useStudySynthesis";

const Root = styled(Box)(() => ({
flex: "0 0 40%",
Expand Down Expand Up @@ -81,6 +82,7 @@ function Notes({ study }: Props) {
);
const [editionMode, setEditionMode] = useState<boolean | "loading">(false);
const [content, setContent] = useState("");
const { status: synthesisStatus } = useStudySynthesis({ studyId: study.id });
const areas = useAppSelector((state) => getAreas(state, study.id));
const links = useAppSelector((state) => getLinks(state, study.id));

Expand Down Expand Up @@ -193,12 +195,22 @@ function Notes({ study }: Props) {
iconColor: getColorForSize(diskUsage || 0),
},
{
content: areas.length,
content:
synthesisStatus === "resolved" ? (
areas.length
) : (
<Skeleton width={100} />
),
label: t("study.areas"),
icon: HubIcon,
},
{
content: links.length,
content:
synthesisStatus === "resolved" ? (
links.length
) : (
<Skeleton width={100} />
),
label: t("study.links"),
icon: LinearScaleIcon,
},
Expand Down
Loading