From 8bbebb65f7431dbfa490b36313560ce5dc3b0c4e Mon Sep 17 00:00:00 2001 From: John Wu <76966357+jwu-fisker@users.noreply.github.com> Date: Mon, 13 Feb 2023 13:24:29 -0800 Subject: [PATCH] CEC-3751 FIx display of closed misc windows (#281) * CEC-3751 FIx display of closed misc windows * Oops --- src/components/DigitalTwin/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/DigitalTwin/index.js b/src/components/DigitalTwin/index.js index 8367a10..d581c9b 100644 --- a/src/components/DigitalTwin/index.js +++ b/src/components/DigitalTwin/index.js @@ -1,7 +1,7 @@ import React from "react"; import { LocalDateTimeString } from "../../utils/dates"; -import { ValidateLocationByParam } from "../../utils/locations" +import { ValidateLocationByParam } from "../../utils/locations"; import useStyles from "../useStyles"; const keyValueTemplate = (key, value) => ( @@ -58,11 +58,10 @@ const DigitalTwin = (props) => {

Misc Windows

{Object.entries(misc_windows).map((value) => { - if (value[1] === 0) { - return keyValueTemplate(value[0], "closed"); + if (value[1] === 0 || value[1] > 100) { + return keyValueTemplate(value[0], `closed ${value[1]}%`); } else { - const percentOpen = Math.min(value[1], 100); - return keyValueTemplate(value[0], `${percentOpen}% open`); + return keyValueTemplate(value[0], `${value[1]}% open`); } })}