Skip to content

Commit eeb2227

Browse files
authored
Merge pull request #1366 from chhsiao1981/zero-pacs
zero-instances in SeriesRow
2 parents 3ccb131 + b2ba2c8 commit eeb2227

File tree

3 files changed

+101
-83
lines changed

3 files changed

+101
-83
lines changed

src/components/Pacs/components/SeriesRow.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ const SeriesRow: React.FC<SeriesRowProps> = ({
5454
"receivedCount:",
5555
receivedCount,
5656
);
57+
58+
const numberOfSeriesRelatedInstances =
59+
info.NumberOfSeriesRelatedInstances || 0;
60+
5761
const isLoading = React.useMemo(
58-
() => isSeriesLoading({ pullState, inCube }),
59-
[pullState, inCube],
62+
() =>
63+
isSeriesLoading({
64+
pullState,
65+
inCube,
66+
numberOfSeriesRelatedInstances,
67+
}),
68+
[pullState, inCube, numberOfSeriesRelatedInstances],
6069
);
6170

6271
const tooltipTitle = React.useMemo(() => {
@@ -103,6 +112,9 @@ const SeriesRow: React.FC<SeriesRowProps> = ({
103112
if (inCube) {
104113
return 100;
105114
}
115+
if (info.NumberOfSeriesRelatedInstances === 0) {
116+
return 100;
117+
}
106118
if (pullState === SeriesPullState.WAITING_OR_COMPLETE) {
107119
return 99;
108120
}

src/components/Pacs/components/helpers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ function getDefaultPacsService(
5151
function isSeriesLoading({
5252
pullState,
5353
inCube,
54-
}: Pick<PacsSeriesState, "pullState" | "inCube">): boolean {
54+
numberOfSeriesRelatedInstances,
55+
}: Pick<PacsSeriesState, "pullState" | "inCube"> & {
56+
numberOfSeriesRelatedInstances: number;
57+
}): boolean {
58+
if (numberOfSeriesRelatedInstances === 0) {
59+
return false;
60+
}
5561
if (pullState === SeriesPullState.WAITING_OR_COMPLETE) {
5662
return inCube === null;
5763
}

0 commit comments

Comments
 (0)