Disable share downloading when EnableDownloads is false.

Fixes https://github.com/navidrome/navidrome/pull/2246#issuecomment-1472341635
This commit is contained in:
Deluan
2023-03-16 13:11:26 -04:00
parent 23c483da10
commit 377e7ebd52
5 changed files with 19 additions and 14 deletions
+11 -9
View File
@@ -33,7 +33,7 @@ export const ShareDialog = () => {
const translate = useTranslate()
const [description, setDescription] = useState('')
const [downloadable, setDownloadable] = useState(
config.defaultDownloadableShare
config.defaultDownloadableShare && config.enableDownloads
)
useEffect(() => {
setDescription('')
@@ -118,14 +118,16 @@ export const ShareDialog = () => {
setDescription(event.target.value)
}}
/>
<BooleanInput
resource={'share'}
source={'downloadable'}
defaultValue={downloadable}
onChange={(value) => {
setDownloadable(value)
}}
/>
{config.enableDownloads && (
<BooleanInput
resource={'share'}
source={'downloadable'}
defaultValue={downloadable}
onChange={(value) => {
setDownloadable(value)
}}
/>
)}
<TranscodingOptionsInput
fullWidth
label={translate('message.shareOriginalFormat')}