Skip to content

Commit

Permalink
adjust lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cretadn22 committed Oct 3, 2024
1 parent 2cecae1 commit 10767d0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,18 @@ function Search({queryJSON, onSearchListScroll, contentContainerStyle}: SearchPr
useEffect(() => {
const newTransactionList: SelectedTransactions = {};
data.forEach((report) => {
const transactions: TransactionListItemType[] = Object.hasOwn(report, 'transactions') && 'transactions' in report ? report.transactions : [];
transactions.forEach((transaction) => {
if (Object.keys(selectedTransactions).includes(transaction.transactionID)) {
newTransactionList[transaction.transactionID] = {
action: transaction.action,
canHold: transaction.canHold,
canUnhold: transaction.canUnhold,
isSelected: selectedTransactions[transaction.transactionID].isSelected,
canDelete: transaction.canDelete,
};
const transactionsData: TransactionListItemType[] = Object.hasOwn(report, 'transactions') && 'transactions' in report ? report.transactions : [];
transactionsData.forEach((transaction) => {
if (!Object.keys(selectedTransactions).includes(transaction.transactionID)) {
return;
}
newTransactionList[transaction.transactionID] = {
action: transaction.action,
canHold: transaction.canHold,
canUnhold: transaction.canUnhold,
isSelected: selectedTransactions[transaction.transactionID].isSelected,
canDelete: transaction.canDelete,
};
});
});
setSelectedTransactions(newTransactionList, data);
Expand Down

0 comments on commit 10767d0

Please sign in to comment.