From 1e11ddaf0f2d4f5b04ebb75fdf51dc0fe5e39ef4 Mon Sep 17 00:00:00 2001 From: Friedjoff Trautwein Date: Wed, 18 Mar 2020 06:47:35 +0100 Subject: [PATCH] fix: show projection result only if forest type and panes are available --- src/components/ProjectionResult.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/ProjectionResult.js b/src/components/ProjectionResult.js index b25a896a..9880336e 100644 --- a/src/components/ProjectionResult.js +++ b/src/components/ProjectionResult.js @@ -19,6 +19,7 @@ function ProjectionResult() { projectionResult: state.projectionResult, })); const { i18n, t } = useTranslation(); + const { forestType } = location; const panes = []; panes.push({ @@ -30,7 +31,7 @@ function ProjectionResult() { const p = r.projections[r.projections.length - 1]; const icons = []; const scenarios = []; - if (projectionMode === 'f') { + if (p && projectionMode === 'f') { if (location.altitudinalZone === p.altitudinalZone) { icons.push(); scenarios.push(t('projectionScenario.today')); @@ -81,9 +82,9 @@ function ProjectionResult() { } }); - return ( + return forestType ? (
- {panes.length > 0 ? ( + {panes.length > 1 ? ( )}
- ); + ) : null; } export default ProjectionResult;