Skip to content

Commit

Permalink
ui: Fix the bug cause by the empty alertlist
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengYanJin committed Apr 20, 2021
1 parent a9e953b commit 849a7eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/src/containers/NodePageRSP.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const NodePageRSP = (props) => {
instance: `${instanceIP}:${PORT_NODE_EXPORTER}`,
});

const alertsNode = alertList && alertList.alerts || [];
const alertsNode = (alertList && alertList.alerts) || [];

const isHealthTabActive = location.pathname.endsWith('/overview');
const isAlertsTabActive = location.pathname.endsWith('/alerts');
Expand All @@ -151,7 +151,7 @@ const NodePageRSP = (props) => {
title: (
<span>
{intl.translate('alerts')}
{alertsNode.length ? (
{alertsNode && alertsNode.length ? (
<TextBadge variant={'infoPrimary'}>{alertsNode.length}</TextBadge>
) : null}
</span>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/containers/VolumePageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const VolumePageContent = (props) => {
title: (
<span>
{intl.translate('alerts')}
{alertlist.length ? (
{alertlist && alertlist.length ? (
<TextBadge variant={'infoPrimary'}>{alertlist.length}</TextBadge>
) : null}
</span>
Expand Down

0 comments on commit 849a7eb

Please sign in to comment.