Skip to content

Commit ba65563

Browse files
Merge pull request #52974 from twilight2294/patch-8
Fix: Selected Xero bank account is not highlighted with a green checkmark
2 parents 9c07d81 + 71d18bd commit ba65563

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pages/workspace/accounting/xero/export/XeroBankAccountSelectPage.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ function XeroBankAccountSelectPage({policy}: WithPolicyConnectionsProps) {
2727
const policyID = policy?.id ?? '-1';
2828

2929
const {config} = policy?.connections?.xero ?? {};
30+
const {bankAccounts} = policy?.connections?.xero?.data ?? {};
3031
const xeroSelectorOptions = useMemo<SelectorType[]>(
31-
() => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount),
32-
[config?.export?.nonReimbursableAccount, policy],
32+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
33+
() => getXeroBankAccounts(policy ?? undefined, config?.export?.nonReimbursableAccount || bankAccounts?.[0]?.id),
34+
[config?.export?.nonReimbursableAccount, policy, bankAccounts],
3335
);
3436

3537
const listHeaderComponent = useMemo(

0 commit comments

Comments
 (0)