Fix null imageUrl on credential

This commit is contained in:
jeffvli
2022-11-04 19:18:35 -07:00
parent fd53f90db2
commit ae53b17214
2 changed files with 7 additions and 6 deletions
@@ -116,14 +116,14 @@ export const AlbumListRoute = () => {
// * Adds server token
if (isImageTokenRequired) {
const t = albums.data.map((album) => {
const data = albums.data.map((album) => {
return {
...album,
imageUrl: album?.imageUrl + serverToken!,
imageUrl: album.imageUrl && album.imageUrl + serverToken!,
};
});
return { ...albums, data: t };
return { ...albums, data };
}
return albums;
@@ -50,9 +50,10 @@ export const usePlayQueueHandler = () => {
songs = songs.map((song) => {
return {
...song,
imageUrl: isImageTokenRequired
? `${song.imageUrl}${serverToken}`
: song.imageUrl,
imageUrl:
song.imageUrl && isImageTokenRequired
? `${song.imageUrl}${serverToken}`
: song.imageUrl,
streamUrl: `${song.streamUrl}${serverToken}`,
};
});