Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/app/_components/StatusBar/CMSStatusBars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ export function CMSStatusBars({ statusBarContent }: { statusBarContent: Incident
? []
: statusBarContent?.items?.filter(
alert =>
(alert.fields.showOnTestnet && isTestnet) ||
(alert.fields.showOnMainnet && !isTestnet) ||
networkUrl?.includes(alert.fields.networkUrlSubstring)
alert.fields.impact !== IncidentImpact.None &&
((alert.fields.showOnTestnet && isTestnet) ||
(alert.fields.showOnMainnet && !isTestnet) ||
networkUrl?.includes(alert.fields.networkUrlSubstring))
);

return (
Expand Down
7 changes: 5 additions & 2 deletions src/app/_components/StatusBar/IncidentsStatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Flex, Stack, StackProps } from '@chakra-ui/react';
import { QueryErrorResetBoundary } from '@tanstack/react-query';
import { useRef } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { IncidentImpact } from 'statuspage.io';

import { useGlobalContext } from '../../../common/context/useGlobalContext';
import { useUnresolvedIncidents } from '../../../common/queries/useUnresolvedIncidents';
Expand All @@ -16,13 +17,15 @@ function IncidentsStatusBarBase(props: StackProps) {
const incidents = unresolvedIncidentsResponse?.incidents;
const statusBarRef = useRef<HTMLDivElement | null>(null);

if (!incidents?.length) {
const incidentsToShow = incidents?.filter(incident => incident.impact !== IncidentImpact.None);

if (!incidentsToShow?.length) {
return null;
}

return (
<Stack {...props}>
{incidents?.map(({ name, impact }) => {
{incidentsToShow?.map(({ name, impact }) => {
const isTestnetUpdate = name.includes('Testnet Update:');
if (isTestnetUpdate && !isTestnet) return null;
const icon = getIncidentImpactIcon(impact);
Expand Down
Loading