From f19da36005f3a742f9f4b466c0bad1bbc8dec90d Mon Sep 17 00:00:00 2001 From: jeffvli Date: Fri, 10 Oct 2025 11:45:11 -0700 Subject: [PATCH] fix favorite column --- .../columns/favorite-column.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/item-list/item-table-list/columns/favorite-column.tsx b/src/renderer/components/item-list/item-table-list/columns/favorite-column.tsx index af4ddac45..23767788f 100644 --- a/src/renderer/components/item-list/item-table-list/columns/favorite-column.tsx +++ b/src/renderer/components/item-list/item-table-list/columns/favorite-column.tsx @@ -27,21 +27,27 @@ export const FavoriteColumn = (props: ItemTableListInnerColumn) => { size: 'md', }} onClick={() => { + if (!props.data?.[props.rowIndex]) { + return; + } + if (row) { deleteFavorite.mutate({ query: { - id: [(props.data as any)?.[props.rowIndex]?.id as string], - type: (props.data as any)?.[props.rowIndex] - ?.itemType as LibraryItem, + id: [(props.data as any)[props.rowIndex].id as string], + type: (props.data as any)[props.rowIndex] + .itemType as LibraryItem, }, + serverId: (props.data as any)[props.rowIndex].serverId as string, }); } else { createFavorite.mutate({ query: { - id: [(props.data as any)?.[props.rowIndex]?.id as string], - type: (props.data as any)?.[props.rowIndex] - ?.itemType as LibraryItem, + id: [(props.data as any)[props.rowIndex].id as string], + type: (props.data as any)[props.rowIndex] + .itemType as LibraryItem, }, + serverId: (props.data as any)[props.rowIndex].serverId as string, }); } }}