diff options
Diffstat (limited to 'modern/src/settings/components/BaseCommandView.js')
-rw-r--r-- | modern/src/settings/components/BaseCommandView.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modern/src/settings/components/BaseCommandView.js b/modern/src/settings/components/BaseCommandView.js index 1ba6a37c..acf39090 100644 --- a/modern/src/settings/components/BaseCommandView.js +++ b/modern/src/settings/components/BaseCommandView.js @@ -1,4 +1,5 @@ import React, { useEffect, useState } from 'react'; +import { useSelector } from 'react-redux'; import { TextField, FormControlLabel, Checkbox, } from '@mui/material'; @@ -10,6 +11,8 @@ import useCommandAttributes from '../../common/attributes/useCommandAttributes'; const BaseCommandView = ({ deviceId, item, setItem }) => { const t = useTranslation(); + const textEnabled = useSelector((state) => state.session.server.textEnabled); + const availableAttributes = useCommandAttributes(t); const [attributes, setAttributes] = useState([]); @@ -63,10 +66,12 @@ const BaseCommandView = ({ deviceId, item, setItem }) => { /> ); })} - <FormControlLabel - control={<Checkbox checked={item.textChannel} onChange={(event) => setItem({ ...item, textChannel: event.target.checked })} />} - label={t('commandSendSms')} - /> + {textEnabled && ( + <FormControlLabel + control={<Checkbox checked={item.textChannel} onChange={(event) => setItem({ ...item, textChannel: event.target.checked })} />} + label={t('commandSendSms')} + /> + )} </> ); }; |