Skip to content

Commit

Permalink
Fix: play button caused error for albums and artists tables
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor3f committed Oct 2, 2024
1 parent 0936951 commit 0e7aafe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { generatePath } from 'react-router';
import { Link } from 'react-router-dom';
import { SimpleImg } from 'react-simple-img';
import styled from 'styled-components';
import { AlbumArtist, Artist, LibraryItem } from '/@/renderer/api/types';
import { AlbumArtist, Artist } from '/@/renderer/api/types';
import { Text } from '/@/renderer/components/text';
import { AppRoute } from '/@/renderer/router/routes';
import { Skeleton } from '/@/renderer/components/skeleton';
Expand Down Expand Up @@ -59,7 +59,7 @@ const StyledImage = styled(SimpleImg)`
}
`;

export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams) => {
export const CombinedTitleCell = ({ value, rowIndex, node, context }: ICellRendererParams) => {
const artists = useMemo(() => {
if (!value) return null;
return value.artists?.length ? value.artists : value.albumArtists;
Expand Down Expand Up @@ -115,7 +115,7 @@ export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams
)}
<ListCoverControls
itemData={value}
itemType={LibraryItem.SONG}
itemType={context.itemType}
/>
</ImageWrapper>
<MetadataWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export const useVirtualTable = <TFilter extends BaseQuery<any>>({
const onCellContextMenu = useHandleTableContextMenu(itemType, contextMenu);

const context = {
itemType,
onCellContextMenu,
};

Expand Down

0 comments on commit 0e7aafe

Please sign in to comment.