Remove the unneeded optional chaining

This commit is contained in:
shamoon 2024-11-24 22:17:26 -08:00
parent 9fe2622a04
commit 416053c963
No known key found for this signature in database

View File

@ -18,7 +18,7 @@ export default function Network({ options, refresh = 1500 }) {
return <Error />; return <Error />;
} }
if (!data) { if (!data || !data.network) {
return ( return (
<Resource <Resource
icon={FaNetworkWired} icon={FaNetworkWired}
@ -35,10 +35,10 @@ export default function Network({ options, refresh = 1500 }) {
return ( return (
<Resource <Resource
icon={FaNetworkWired} icon={FaNetworkWired}
value={`${t("common.byterate", { value: data?.network?.tx_sec })} ↑`} value={`${t("common.byterate", { value: data.network.tx_sec })} ↑`}
label={`${t("common.byterate", { value: data?.network?.rx_sec })} ↓`} label={`${t("common.byterate", { value: data.network.rx_sec })} ↓`}
expandedValue={`${t("common.bbytes", { value: data?.network?.tx_bytes })} ↑`} expandedValue={`${t("common.bbytes", { value: data.network.tx_bytes })} ↑`}
expandedLabel={`${t("common.bbytes", { value: data?.network?.rx_bytes })} ↓`} expandedLabel={`${t("common.bbytes", { value: data.network.rx_bytes })} ↓`}
expanded={options.expanded} expanded={options.expanded}
wide wide
percentage="0" percentage="0"