From 1969bd54e97ddae9fd3c4a4f34426cebf28cb421 Mon Sep 17 00:00:00 2001 From: Mingcan Li Date: Fri, 1 Mar 2024 12:13:46 -0600 Subject: [PATCH] Fix battery --- Frontend/src/Components/BatteryPack/BatteryPack.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Frontend/src/Components/BatteryPack/BatteryPack.js b/Frontend/src/Components/BatteryPack/BatteryPack.js index ac9af0d7..71771b20 100644 --- a/Frontend/src/Components/BatteryPack/BatteryPack.js +++ b/Frontend/src/Components/BatteryPack/BatteryPack.js @@ -9,9 +9,9 @@ export default function BatteryPack(props) { const headerBg = getColor("header", colorMode); const borderColor = getColor("border", colorMode); - const fanEnableText = ((props.data?.fan_enable[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.fan_enable[0] ? 'EN' : 'DIS'); - const fanEnableColor = (props.data?.fan_enable[0] ?? false) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode); - const fanEnableTextColor = (props.data?.fan_enable[0] ?? false) ? getColor("txtGreenBg", colorMode) : getColor("txtRedBg", colorMode); + const fanEnableText = ((props.data?.fan_speed[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.fan_speed[0] ? 'EN' : 'DIS'); + const fanEnableColor = (props.data?.fan_speed[0] ?? false) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode); + const fanEnableTextColor = (props.data?.fan_speed[0] ?? false) ? getColor("txtGreenBg", colorMode) : getColor("txtRedBg", colorMode); const chargeEnableText = ((props.data?.charge_enable[0] ?? -1.0) === -1.0) ? 'N/A' : (props.data.charge_enable[0] ? 'High' : 'Low'); const chargeEnableColor = ((props.data?.charge_enable[0] ?? -1.0) == CONSTANTS.charge_enable.MAX) ? getColor("greenBg", colorMode) : getColor("redBg", colorMode);