mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-07 05:41:07 +03:00
Show AutomcompleteInput even if the list of playlists is not loaded yet
This commit is contained in:
parent
1607dc8b88
commit
9c940cd44f
@ -25,7 +25,7 @@ const AddToPlaylistDialog = () => {
|
|||||||
const notify = useNotify()
|
const notify = useNotify()
|
||||||
const [value, setValue] = useState({})
|
const [value, setValue] = useState({})
|
||||||
const dataProvider = useDataProvider()
|
const dataProvider = useDataProvider()
|
||||||
const [create] = useCreate(
|
const [createAndAddToPlaylist] = useCreate(
|
||||||
'playlist',
|
'playlist',
|
||||||
{ name: value.name },
|
{ name: value.name },
|
||||||
{
|
{
|
||||||
@ -74,7 +74,7 @@ const AddToPlaylistDialog = () => {
|
|||||||
if (value.id) {
|
if (value.id) {
|
||||||
addToPlaylist(value.id)
|
addToPlaylist(value.id)
|
||||||
} else {
|
} else {
|
||||||
create()
|
createAndAddToPlaylist()
|
||||||
}
|
}
|
||||||
dispatch(closeAddToPlaylist())
|
dispatch(closeAddToPlaylist())
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
@ -11,18 +11,14 @@ const filter = createFilterOptions()
|
|||||||
|
|
||||||
const SelectPlaylistInput = ({ onChange }) => {
|
const SelectPlaylistInput = ({ onChange }) => {
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
const { ids, data, loaded } = useGetList(
|
const { ids, data } = useGetList(
|
||||||
'playlist',
|
'playlist',
|
||||||
{ page: 1, perPage: -1 },
|
{ page: 1, perPage: -1 },
|
||||||
{ field: 'name', order: 'ASC' },
|
{ field: 'name', order: 'ASC' },
|
||||||
{}
|
{}
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!loaded) {
|
const options = ids && ids.map((id) => data[id])
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = ids.map((id) => data[id])
|
|
||||||
|
|
||||||
const handleOnChange = (event, newValue) => {
|
const handleOnChange = (event, newValue) => {
|
||||||
if (newValue == null) {
|
if (newValue == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user