Skip to content

Commit 4ab58a7

Browse files
Merge pull request #218 from ISISComputingGroup/wall_display_NaN_fix
fix beam current PVs being NaN as string
2 parents de4bb5e + f178af5 commit 4ab58a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/components/TargetStation.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function TargetStation({
88
}: {
99
name: string;
1010
instruments: Array<instListEntryWithRunstatePVandValue>;
11-
beamCurrent: number | null | undefined;
11+
beamCurrent: number | string | null | undefined;
1212
}) {
1313
instruments = instruments.sort((instrumenta, instrumentb) =>
1414
instrumenta.name.localeCompare(instrumentb.name),
@@ -17,7 +17,9 @@ export default function TargetStation({
1717
<div className="flex flex-col justify-center items-start w-full">
1818
<h1 className="w-full text-left text-gray-600 dark:text-gray-200 font-semibold text-md mt-2 py-2 ">
1919
{name}{" "}
20-
{beamCurrent !== undefined && beamCurrent !== null
20+
{beamCurrent !== undefined &&
21+
beamCurrent !== null &&
22+
typeof beamCurrent !== "string"
2123
? "- " + beamCurrent.toFixed(2) + " μA"
2224
: ""}
2325
</h1>

0 commit comments

Comments
 (0)