diff --git a/src/components/ForestTypeModal.js b/src/components/ForestTypeModal.js index 675b5979..2cb96095 100644 --- a/src/components/ForestTypeModal.js +++ b/src/components/ForestTypeModal.js @@ -12,19 +12,23 @@ function ForestTypeModal() { const { search } = useLocation(); const { t } = useTranslation(); const dispatch = useDispatch(); - const forestTypes = useSelector(state => state.forestTypes); - const selectForestType = forestType => { + const forestTypes = useSelector((state) => state.forestTypes); + const selectForestType = (forestType) => { dispatch(setForestTypes([])); dispatch(setFormLocation({ forestType })); history.push(`/projection${search}`); }; + if (forestTypes.length === 1) { + selectForestType(forestTypes[0]); + } + return ( - 0}> + 1}> {t('forestType.select')} - {forestTypes.map(f => ( + {forestTypes.map((f) => (