Skip to content

Commit

Permalink
Fix bugs in payee table (#3768)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming authored Nov 2, 2024
1 parent dc42504 commit 6666014
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/desktop-client/src/components/payees/PayeeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { type PayeeEntity } from 'loot-core/src/types/models';

import { useSelectedItems } from '../../hooks/useSelected';
import { View } from '../common/View';
import { Table } from '../table';
import { useTableNavigator, Table } from '../table';

import { PayeeTableRow } from './PayeeTableRow';

Expand Down Expand Up @@ -46,9 +46,16 @@ export const PayeeTable = forwardRef<
setHovered(id);
}, []);

const tableNavigator = useTableNavigator(payees, item =>
item.transfer_acct == null
? ['select', 'name', 'rule-count']
: ['rule-count'],
);

return (
<View style={{ flex: 1 }} onMouseLeave={() => setHovered(null)}>
<Table
navigator={tableNavigator}
ref={ref}
items={payees}
renderItem={({ item, editing, focusedField, onEdit }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ export const PayeeTableRow = memo(
focused={focusedField === 'select'}
selected={selected}
onSelect={e => {
if (payee.transfer_acct != null) {
return;
}
dispatchSelected({
type: 'select',
id: payee.id,
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3768.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [jfdoming]
---

Fix bugs on payee management page

0 comments on commit 6666014

Please sign in to comment.