safe param access
This commit is contained in:
1 parent
cfb5c7ae5d
commit
4c3b348642
5 files changed
+8
-7
No files matched your search
@@ -123,7 +123,7 @@ const ChartBoxes = ({
|
|||||||
icon={<AverageResponseIcon />}
|
icon={<AverageResponseIcon />}
|
||||||
header="Average Response Time"
|
header="Average Response Time"
|
||||||
>
|
>
|
||||||
<ResponseGaugeChart avgResponseTime={monitor.avgResponseTime ?? 0} />
|
<ResponseGaugeChart avgResponseTime={monitor?.avgResponseTime ?? 0} />
|
||||||
</ChartBox>
|
</ChartBox>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
@@ -133,7 +133,7 @@ export default ChartBoxes;
|
|||||||
|
|
||||||
ChartBoxes.propTypes = {
|
ChartBoxes.propTypes = {
|
||||||
shouldRender: PropTypes.bool,
|
shouldRender: PropTypes.bool,
|
||||||
monitor: PropTypes.object.isRequired,
|
monitor: PropTypes.object,
|
||||||
dateRange: PropTypes.string.isRequired,
|
dateRange: PropTypes.string.isRequired,
|
||||||
uiTimezone: PropTypes.string.isRequired,
|
uiTimezone: PropTypes.string.isRequired,
|
||||||
dateFormat: PropTypes.string.isRequired,
|
dateFormat: PropTypes.string.isRequired,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const DownBarChart = memo(({ monitor, type, onBarHover }) => {
|
|||||||
<BarChart
|
<BarChart
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
data={monitor.groupedDownChecks}
|
data={monitor?.groupedDownChecks}
|
||||||
onMouseEnter={() => {
|
onMouseEnter={() => {
|
||||||
setChartHovered(true);
|
setChartHovered(true);
|
||||||
onBarHover({ time: null, totalChecks: 0 });
|
onBarHover({ time: null, totalChecks: 0 });
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const ResponseTImeChart = ({ shouldRender = true, monitor, dateRange }) => {
|
|||||||
header="Response Times"
|
header="Response Times"
|
||||||
>
|
>
|
||||||
<MonitorDetailsAreaChart
|
<MonitorDetailsAreaChart
|
||||||
checks={monitor.groupedChecks ?? []}
|
checks={monitor?.groupedChecks ?? []}
|
||||||
dateRange={dateRange}
|
dateRange={dateRange}
|
||||||
/>
|
/>
|
||||||
</ChartBox>
|
</ChartBox>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { formatDateWithTz } from "../../../../../Utils/timeUtils";
|
|||||||
import SkeletonLayout from "./skeleton";
|
import SkeletonLayout from "./skeleton";
|
||||||
const ResponseTable = ({
|
const ResponseTable = ({
|
||||||
shouldRender = true,
|
shouldRender = true,
|
||||||
checks,
|
checks = [],
|
||||||
checksCount,
|
checksCount,
|
||||||
uiTimezone,
|
uiTimezone,
|
||||||
page,
|
page,
|
||||||
@@ -77,8 +77,8 @@ const ResponseTable = ({
|
|||||||
|
|
||||||
ResponseTable.propTypes = {
|
ResponseTable.propTypes = {
|
||||||
shouldRender: PropTypes.bool,
|
shouldRender: PropTypes.bool,
|
||||||
checks: PropTypes.array.isRequired,
|
checks: PropTypes.array,
|
||||||
checksCount: PropTypes.number.isRequired,
|
checksCount: PropTypes.number,
|
||||||
uiTimezone: PropTypes.string.isRequired,
|
uiTimezone: PropTypes.string.isRequired,
|
||||||
page: PropTypes.number.isRequired,
|
page: PropTypes.number.isRequired,
|
||||||
setPage: PropTypes.func.isRequired,
|
setPage: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import useUtils from "../../../Monitors/Hooks/useUtils";
|
|||||||
const UptimeStatusBoxes = ({ shouldRender, monitor, certificateExpiry }) => {
|
const UptimeStatusBoxes = ({ shouldRender, monitor, certificateExpiry }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { determineState } = useUtils();
|
const { determineState } = useUtils();
|
||||||
|
|
||||||
const { time: streakTime, units: streakUnits } = getHumanReadableDuration(
|
const { time: streakTime, units: streakUnits } = getHumanReadableDuration(
|
||||||
monitor?.uptimeStreak
|
monitor?.uptimeStreak
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user