diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx index c26fe412d02..60f581b60c0 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.jsx +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.jsx @@ -2105,9 +2105,9 @@ export const TransactionTable = forwardRef((props, ref) => { result = props.transactions.filter((t, idx) => { if (t.parent_id) { if (idx >= index) { - return splitsExpanded.expanded(t.parent_id); + return splitsExpanded.isExpanded(t.parent_id); } else if (prevSplitsExpanded.current) { - return prevSplitsExpanded.current.expanded(t.parent_id); + return prevSplitsExpanded.current.isExpanded(t.parent_id); } } return true; @@ -2124,7 +2124,7 @@ export const TransactionTable = forwardRef((props, ref) => { result = props.transactions.filter(t => { if (t.parent_id) { - return splitsExpanded.expanded(t.parent_id); + return splitsExpanded.isExpanded(t.parent_id); } return true; }); @@ -2595,7 +2595,7 @@ export const TransactionTable = forwardRef((props, ref) => { transactionsByParent={transactionsByParent} transferAccountsByTransaction={transferAccountsByTransaction} selectedItems={selectedItems} - isExpanded={splitsExpanded.expanded} + isExpanded={splitsExpanded.isExpanded} onSave={onSave} onDelete={onDelete} onDuplicate={onDuplicate} diff --git a/packages/desktop-client/src/hooks/useSplitsExpanded.tsx b/packages/desktop-client/src/hooks/useSplitsExpanded.tsx index 10728ec34b7..25386d2dcec 100644 --- a/packages/desktop-client/src/hooks/useSplitsExpanded.tsx +++ b/packages/desktop-client/src/hooks/useSplitsExpanded.tsx @@ -73,7 +73,7 @@ export function useSplitsExpanded() { return useMemo( () => ({ ...data, - expanded: (id: string) => + isExpanded: (id: string) => data.state.mode === 'collapse' ? !data.state.ids.has(id) : data.state.ids.has(id),