mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
Fix song null check on queue add
This commit is contained in:
parent
de50002ea7
commit
7c6f62023a
1 changed files with 3 additions and 2 deletions
|
|
@ -118,10 +118,11 @@ export const useHandlePlayQueueAdd = () => {
|
||||||
|
|
||||||
songs = songList?.items?.map((song: Song) => ({ ...song, uniqueId: nanoid() })) || null;
|
songs = songList?.items?.map((song: Song) => ({ ...song, uniqueId: nanoid() })) || null;
|
||||||
} else if (byData) {
|
} else if (byData) {
|
||||||
songs = byData.map((song) => ({ ...song, uniqueId: nanoid() }));
|
songs = byData.map((song) => ({ ...song, uniqueId: nanoid() })) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!songs) return toast.warn({ message: 'No songs found' });
|
if (!songs || songs?.length === 0)
|
||||||
|
return toast.warn({ message: 'The query returned no results', title: 'No tracks added' });
|
||||||
|
|
||||||
if (initialIndex) {
|
if (initialIndex) {
|
||||||
initialSongIndex = initialIndex;
|
initialSongIndex = initialIndex;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue