Skip to content

Commit

Permalink
minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hungvu193 committed May 3, 2024
1 parent cf2cd2f commit 056648c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) {
const xeroConfig = policy?.connections?.xero?.config;
const {autoSync, pendingFields, sync} = xeroConfig ?? {};
const {bankAccounts} = policy?.connections?.xero?.data ?? {};
const {invoiceCollectionsAccountID} = sync ?? {};

const selectedBankAccountName = useMemo(() => {
const {invoiceCollectionsAccountID} = sync ?? {};
const selectedAccount = (bankAccounts ?? []).find((bank) => bank.id === invoiceCollectionsAccountID);

return selectedAccount?.name ?? '';
}, [sync, bankAccounts]);
}, [sync, bankAccounts, invoiceCollectionsAccountID]);

Check warning on line 31 in src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

React Hook useMemo has an unnecessary dependency: 'sync'. Either exclude it or remove the dependency array

return (
<ConnectionLayout
Expand Down

0 comments on commit 056648c

Please sign in to comment.