From 0e7aafeabe6d41610e904b667ac01ae1ce5868e9 Mon Sep 17 00:00:00 2001 From: Egor Aristov Date: Wed, 2 Oct 2024 12:29:34 +0300 Subject: [PATCH] Fix: play button caused error for albums and artists tables --- .../components/virtual-table/cells/combined-title-cell.tsx | 6 +++--- .../components/virtual-table/hooks/use-virtual-table.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/virtual-table/cells/combined-title-cell.tsx b/src/renderer/components/virtual-table/cells/combined-title-cell.tsx index e1454707..b2b344da 100644 --- a/src/renderer/components/virtual-table/cells/combined-title-cell.tsx +++ b/src/renderer/components/virtual-table/cells/combined-title-cell.tsx @@ -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'; @@ -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; @@ -115,7 +115,7 @@ export const CombinedTitleCell = ({ value, rowIndex, node }: ICellRendererParams )} diff --git a/src/renderer/components/virtual-table/hooks/use-virtual-table.ts b/src/renderer/components/virtual-table/hooks/use-virtual-table.ts index d16c24b3..f0e05bfa 100644 --- a/src/renderer/components/virtual-table/hooks/use-virtual-table.ts +++ b/src/renderer/components/virtual-table/hooks/use-virtual-table.ts @@ -334,6 +334,7 @@ export const useVirtualTable = >({ const onCellContextMenu = useHandleTableContextMenu(itemType, contextMenu); const context = { + itemType, onCellContextMenu, };