From 8f6ae97ef9cc9647a14aad0c0d96d6107f7086e8 Mon Sep 17 00:00:00 2001 From: emelko Date: Sun, 20 Dec 2020 17:18:17 +0100 Subject: [PATCH 1/2] No warning msg if there is no temp data --- components/helpers/cycle-day.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/helpers/cycle-day.js b/components/helpers/cycle-day.js index aae8a3f..1912284 100644 --- a/components/helpers/cycle-day.js +++ b/components/helpers/cycle-day.js @@ -33,7 +33,7 @@ export const isPreviousTemperature = (temperature) => { } export const isTemperatureOutOfRange = (temperature) => { - if (temperature === '') return null + if (temperature === null) return null const value = Number(temperature) const range = { min: TEMP_MIN, max: TEMP_MAX } From 4e6653c54c45cccf98f65ac5d1b41f47b432da9e Mon Sep 17 00:00:00 2001 From: emelko Date: Tue, 22 Dec 2020 22:24:57 +0100 Subject: [PATCH 2/2] Check for falsy value --- components/helpers/cycle-day.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/helpers/cycle-day.js b/components/helpers/cycle-day.js index 1912284..d862a37 100644 --- a/components/helpers/cycle-day.js +++ b/components/helpers/cycle-day.js @@ -33,7 +33,7 @@ export const isPreviousTemperature = (temperature) => { } export const isTemperatureOutOfRange = (temperature) => { - if (temperature === null) return null + if (!temperature) return null const value = Number(temperature) const range = { min: TEMP_MIN, max: TEMP_MAX }