[bugfix]: fix combined title for artist, favoriting on grid pages

This commit is contained in:
Kendall Garner 2024-04-08 23:15:59 -07:00
parent 14086ebc9c
commit 15c6ef382a
No known key found for this signature in database
GPG key ID: 18D2767419676C87
7 changed files with 70 additions and 86 deletions

View file

@ -19,6 +19,7 @@ export type VirtualInfiniteGridRef = {
resetLoadMoreItemsCache: () => void;
scrollTo: (index: number) => void;
setItemData: (data: any[]) => void;
updateItemData: (rule: (item: any) => any) => void;
};
interface VirtualGridProps
@ -135,6 +136,9 @@ export const VirtualInfiniteGrid = forwardRef(
setItemData: (data: any[]) => {
setItemData(data);
},
updateItemData: (rule) => {
setItemData((data) => data.map(rule));
},
}));
if (loading) return null;

View file

@ -50,7 +50,7 @@ const StyledImage = styled(SimpleImg)`
export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams) => {
const artists = useMemo(() => {
if (!value) return null;
return value.artists.length ? value.artists : value.albumArtists;
return value.artists?.length ? value.artists : value.albumArtists;
}, [value]);
if (value === undefined) {