From 8222abffca3ca9420e8c377387fc43cb3ea47206 Mon Sep 17 00:00:00 2001 From: z0ccc Date: Wed, 29 Sep 2021 00:27:25 -0400 Subject: [PATCH] Display 'N/A' if value is undefined --- frontend/src/components/TableRow.js | 2 +- frontend/src/utils/other.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/TableRow.js b/frontend/src/components/TableRow.js index eaff169..b0e4464 100644 --- a/frontend/src/components/TableRow.js +++ b/frontend/src/components/TableRow.js @@ -36,7 +36,7 @@ const TableRow = ({ item }) => { <> {item.key} - {item.value} + {item.value || 'N/A'} {issues ? ( diff --git a/frontend/src/utils/other.js b/frontend/src/utils/other.js index 8396fd8..9a6fd91 100644 --- a/frontend/src/utils/other.js +++ b/frontend/src/utils/other.js @@ -22,12 +22,8 @@ const checkDatePrototype = () => { // Returns object with location data const getOther = (battery, adBlock, workerData) => { - console.log(battery); let batteryLevel, batteryStatus; - if (battery === 'N/A') { - batteryLevel = 'N/A'; - batteryStatus = 'N/A'; - } else { + if (battery !== 'N/A') { batteryLevel = `${Math.round(battery.level * 100)}%`; batteryStatus = battery.charging ? 'Charging' : 'Not charging'; }