diff --git a/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx b/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx index 040b89a436e6..a8a7eb10b0e0 100644 --- a/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx +++ b/src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx @@ -27,9 +27,11 @@ function XeroBankAccountSelectPage({policy}: WithPolicyConnectionsProps) { const policyID = policy?.id ?? '-1'; const {config} = policy?.connections?.xero ?? {}; + const {bankAccounts} = policy?.connections?.xero?.data ?? {}; const xeroSelectorOptions = useMemo( - () => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount), - [config?.export?.nonReimbursableAccount, policy], + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + () => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount || bankAccounts?.[0]?.id), + [config?.export?.nonReimbursableAccount, policy, bankAccounts], ); const listHeaderComponent = useMemo(