fix(ui): show last.fm api-key missing in a FormHelperText
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useNotify, useTranslate } from 'react-admin'
|
|||||||
import {
|
import {
|
||||||
FormControl,
|
FormControl,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
|
FormHelperText,
|
||||||
LinearProgress,
|
LinearProgress,
|
||||||
Switch,
|
Switch,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@@ -102,14 +103,13 @@ export const LastfmScrobbleToggle = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FormControl>
|
<FormControl>
|
||||||
{apiKey ? (
|
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
control={
|
control={
|
||||||
<Switch
|
<Switch
|
||||||
id={'lastfm'}
|
id={'lastfm'}
|
||||||
color="primary"
|
color="primary"
|
||||||
checked={linked || checkingLink}
|
checked={linked || checkingLink}
|
||||||
disabled={linked === null || checkingLink}
|
disabled={!apiKey || linked === null || checkingLink}
|
||||||
onChange={toggleScrobble}
|
onChange={toggleScrobble}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -117,17 +117,6 @@ export const LastfmScrobbleToggle = (props) => {
|
|||||||
<span>{translate('menu.personal.options.lastfmScrobbling')}</span>
|
<span>{translate('menu.personal.options.lastfmScrobbling')}</span>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
|
||||||
<Tooltip title={translate('menu.personal.options.lastfmNotConfigured')}>
|
|
||||||
<FormControlLabel
|
|
||||||
disabled={true}
|
|
||||||
control={<Switch id={'lastfm'} color="primary" />}
|
|
||||||
label={
|
|
||||||
<span>{translate('menu.personal.options.lastfmScrobbling')}</span>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
{checkingLink && (
|
{checkingLink && (
|
||||||
<Progress
|
<Progress
|
||||||
setLinked={setLinked}
|
setLinked={setLinked}
|
||||||
@@ -135,6 +124,11 @@ export const LastfmScrobbleToggle = (props) => {
|
|||||||
apiKey={apiKey}
|
apiKey={apiKey}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{!apiKey && (
|
||||||
|
<FormHelperText id="scrobble-lastfm-disabled-helper-text">
|
||||||
|
{translate('menu.personal.options.lastfmNotConfigured')}
|
||||||
|
</FormHelperText>
|
||||||
|
)}
|
||||||
</FormControl>
|
</FormControl>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user