Skip to content

Commit

Permalink
Merge pull request #657 from kbss-cvut/fix/656-fix-blank-screen-when-…
Browse files Browse the repository at this point in the history
…selecting-root-node

Refactor local variables overriding function statusMessage
  • Loading branch information
blcham authored Nov 12, 2024
2 parents 5e7dc0d + 961af41 commit c0e25a9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,16 +322,16 @@ const FaultEventMenu = ({
);
};

const failureRateComponent = (failureRate, failureRateCode, statusMessages: string[] = []) => {
const _statusMessages = asArray(statusMessages);
const isOutOfSync = _statusMessages && _statusMessages.length > 0;
const failureRateComponent = (failureRate, failureRateCode, messages: string[] = []) => {
const _messages = asArray(messages);
const isOutOfSync = _messages && _messages.length > 0;
const cls = isOutOfSync ? classes.outdated : classes.notEditableValue;
return (
<Typography className={classes.eventPropertyRow}>
{propertyLabelWithHint(failureRateCode)}
<Box className={[classes.eventPropertyRow, cls]}>
{numberValue(failureRate)}
{isOutOfSync && syncProblemIcon(statusMessages(_statusMessages), _statusMessages.length)}
{isOutOfSync && syncProblemIcon(statusMessages(_messages), _messages.length)}
</Box>
</Typography>
);
Expand Down

0 comments on commit c0e25a9

Please sign in to comment.