mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
[bugfix]: fix combined title for artist, favoriting on grid pages
This commit is contained in:
parent
14086ebc9c
commit
15c6ef382a
7 changed files with 70 additions and 86 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue