Skip to content

Commit

Permalink
measurements: display error even if data not loaded
Browse files Browse the repository at this point in the history
Allow the measurements panel to display any errors even if the
measurements data failed to load. This will allow users to see
errors in the measurement's panel even if the warning notification
goes away.
  • Loading branch information
joverlee521 committed Oct 29, 2024
1 parent 0861269 commit a2431ae
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/components/measurements/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,20 +343,19 @@ const Measurements = ({height, width, showLegend}) => {

return (
<Card infocard={showOnlyPanels} title={title} titleStyles={getCardTitleStyle()}>
{measurementsLoaded &&
(measurementsError ?
<Flex style={{ height, width}} direction="column" justifyContent="center">
<p style={{ textAlign: "center" }}>
{measurementsError}
</p>
</Flex> :
<MeasurementsPlot
height={height}
width={width}
showLegend={showLegend}
setPanelTitle={setTitle}
/>
)
{measurementsError ?
<Flex style={{ height, width}} direction="column" justifyContent="center">
<p style={{ textAlign: "center" }}>
{measurementsError}
</p>
</Flex> :
(measurementsLoaded &&
<MeasurementsPlot
height={height}
width={width}
showLegend={showLegend}
setPanelTitle={setTitle}
/>)
}
</Card>
);
Expand Down

0 comments on commit a2431ae

Please sign in to comment.