From b75df536dfa8a64817c67764120939039ef9b871 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 3 Jul 2022 16:07:02 -0700 Subject: Address link only if enabled (fix #756) --- modern/src/common/components/AddressValue.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modern/src/common/components/AddressValue.js b/modern/src/common/components/AddressValue.js index 767f516b..36369c69 100644 --- a/modern/src/common/components/AddressValue.js +++ b/modern/src/common/components/AddressValue.js @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; +import { useSelector } from 'react-redux'; import { Link } from '@mui/material'; import { useTranslation } from './LocalizationProvider'; import { useCatch } from '../../reactHelper'; @@ -6,6 +7,8 @@ import { useCatch } from '../../reactHelper'; const AddressValue = ({ latitude, longitude, originalAddress }) => { const t = useTranslation(); + const addressEnabled = useSelector((state) => state.session.server.geocoderEnabled); + const [address, setAddress] = useState(); useEffect(() => { @@ -25,7 +28,10 @@ const AddressValue = ({ latitude, longitude, originalAddress }) => { if (address) { return address; } - return ({t('sharedShowAddress')}); + if (addressEnabled) { + return ({t('sharedShowAddress')}); + } + return ''; }; export default AddressValue; -- cgit v1.2.3