Fix current song row when queue is empty
This commit is contained in:
parent
452ef783f2
commit
86fb52f6d4
2 changed files with 7 additions and 1 deletions
|
@ -40,6 +40,7 @@ export const useCurrentSongRowStyles = ({ tableRef }: UseCurrentSongRowStylesPro
|
||||||
return {
|
return {
|
||||||
'current-song': (params) => {
|
'current-song': (params) => {
|
||||||
return (
|
return (
|
||||||
|
currentSong?.id !== undefined &&
|
||||||
params?.data?.id === currentSong?.id &&
|
params?.data?.id === currentSong?.id &&
|
||||||
params?.data?.albumId === currentSong?.albumId
|
params?.data?.albumId === currentSong?.albumId
|
||||||
);
|
);
|
||||||
|
|
|
@ -280,10 +280,14 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
cellClass: 'row-index',
|
cellClass: 'row-index',
|
||||||
cellClassRules: {
|
cellClassRules: {
|
||||||
'current-playlist-song-cell': (params) => {
|
'current-playlist-song-cell': (params) => {
|
||||||
return params.data?.uniqueId === params.context?.currentSong?.uniqueId;
|
return (
|
||||||
|
params.context?.currentSong?.uniqueId !== undefined &&
|
||||||
|
params.data?.uniqueId === params.context?.currentSong?.uniqueId
|
||||||
|
);
|
||||||
},
|
},
|
||||||
'current-song-cell': (params) => {
|
'current-song-cell': (params) => {
|
||||||
return (
|
return (
|
||||||
|
params.context?.currentSong?.id !== undefined &&
|
||||||
params.data?.id === params.context?.currentSong?.id &&
|
params.data?.id === params.context?.currentSong?.id &&
|
||||||
params.data?.albumId === params.context?.currentSong?.albumId
|
params.data?.albumId === params.context?.currentSong?.albumId
|
||||||
);
|
);
|
||||||
|
@ -363,6 +367,7 @@ const tableColumns: { [key: string]: ColDef } = {
|
||||||
cellClassRules: {
|
cellClassRules: {
|
||||||
'current-song-cell': (params) => {
|
'current-song-cell': (params) => {
|
||||||
return (
|
return (
|
||||||
|
params.context?.currentSong?.id !== undefined &&
|
||||||
params.data?.id === params.context?.currentSong?.id &&
|
params.data?.id === params.context?.currentSong?.id &&
|
||||||
params.data?.albumId === params.context?.currentSong?.albumId
|
params.data?.albumId === params.context?.currentSong?.albumId
|
||||||
);
|
);
|
||||||
|
|
Reference in a new issue