diff --git a/components/chart/chart.js b/components/chart/chart.js index c475ae2..b394129 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -21,6 +21,7 @@ import { noteTrackingCategoryObservable, painTrackingCategoryObservable, sexTrackingCategoryObservable, + temperatureTrackingCategoryObservable, } from '../../local-storage' import { makeColumnInfo } from '../helpers/chart' @@ -84,7 +85,11 @@ const CycleChart = ({ navigate, setDate }) => { } }) - const shouldShowTemperatureColumn = chartSymptoms.indexOf('temperature') > -1 + const isTemperatureEnabled = temperatureTrackingCategoryObservable.value + const shouldShowTemperatureColumn = + isTemperatureEnabled && chartSymptoms.indexOf('temperature') > -1 + const shouldShowNoDataWarning = + isTemperatureEnabled && chartSymptoms.indexOf('temperature') <= -1 const { width, height } = Dimensions.get('window') const numberOfColumnsToRender = Math.round(width / CHART_COLUMN_WIDTH) @@ -135,7 +140,7 @@ const CycleChart = ({ navigate, setDate }) => { > {shouldShowHint && } - {!shouldShowTemperatureColumn && } + {shouldShowNoDataWarning && }