Disable disallowed settings (#461)

This commit is contained in:
schroda
2023-11-19 00:10:30 +01:00
committed by GitHub
parent eda682d9ab
commit 1fd9b4e744
6 changed files with 80 additions and 85 deletions

View File

@@ -92,20 +92,17 @@ export const DownloadSettings = () => {
/>
</ListItemSecondaryAction>
</ListItem>
{downloadSettings?.autoDownloadNewChapters ? (
<ListItem>
<ListItemText
primary={t('download.settings.auto_download.label.ignore_with_unread_chapters')}
<ListItem disabled={!downloadSettings?.autoDownloadNewChapters}>
<ListItemText primary={t('download.settings.auto_download.label.ignore_with_unread_chapters')} />
<ListItemSecondaryAction>
<Switch
edge="end"
checked={!!downloadSettings?.excludeEntryWithUnreadChapters}
onChange={(e) => updateSetting('excludeEntryWithUnreadChapters', e.target.checked)}
disabled={!downloadSettings?.autoDownloadNewChapters}
/>
<ListItemSecondaryAction>
<Switch
edge="end"
checked={downloadSettings.excludeEntryWithUnreadChapters}
onChange={(e) => updateSetting('excludeEntryWithUnreadChapters', e.target.checked)}
/>
</ListItemSecondaryAction>
</ListItem>
) : null}
</ListItemSecondaryAction>
</ListItem>
</List>
<List
subheader={

View File

@@ -175,20 +175,18 @@ export const ServerSettings = () => {
/>
</ListItemSecondaryAction>
</ListItem>
{!!serverSettings?.socksProxyEnabled && (
<>
<TextSetting
settingName={t('settings.server.socks_proxy.label.host')}
value={serverSettings.socksProxyHost}
handleChange={(proxyHost) => updateSetting('socksProxyHost', proxyHost)}
/>
<TextSetting
settingName={t('settings.server.socks_proxy.label.port')}
value={serverSettings.socksProxyPort}
handleChange={(proxyPort) => updateSetting('socksProxyPort', proxyPort)}
/>
</>
)}
<TextSetting
settingName={t('settings.server.socks_proxy.label.host')}
value={serverSettings?.socksProxyHost}
handleChange={(proxyHost) => updateSetting('socksProxyHost', proxyHost)}
disabled={!serverSettings?.socksProxyEnabled}
/>
<TextSetting
settingName={t('settings.server.socks_proxy.label.port')}
value={serverSettings?.socksProxyPort}
handleChange={(proxyPort) => updateSetting('socksProxyPort', proxyPort)}
disabled={!serverSettings?.socksProxyEnabled}
/>
</List>
<List
subheader={
@@ -207,21 +205,19 @@ export const ServerSettings = () => {
/>
</ListItemSecondaryAction>
</ListItem>
{!!serverSettings?.basicAuthEnabled && (
<>
<TextSetting
settingName={t('settings.server.auth.basic.label.username')}
value={serverSettings?.basicAuthUsername}
handleChange={(authUsername) => updateSetting('basicAuthUsername', authUsername)}
/>
<TextSetting
settingName={t('settings.server.auth.basic.label.password')}
value={serverSettings?.basicAuthPassword}
isPassword
handleChange={(authPassword) => updateSetting('basicAuthPassword', authPassword)}
/>
</>
)}
<TextSetting
settingName={t('settings.server.auth.basic.label.username')}
value={serverSettings?.basicAuthUsername}
handleChange={(authUsername) => updateSetting('basicAuthUsername', authUsername)}
disabled={!serverSettings?.basicAuthEnabled}
/>
<TextSetting
settingName={t('settings.server.auth.basic.label.password')}
value={serverSettings?.basicAuthPassword}
isPassword
handleChange={(authPassword) => updateSetting('basicAuthPassword', authPassword)}
disabled={!serverSettings?.basicAuthEnabled}
/>
</List>
<List
subheader={