Skip to content

Commit 25a21b0

Browse files
committed
fix react-compiler issue
1 parent 588f5c8 commit 25a21b0

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/pages/workspace/accounting/qbo/advanced/QuickbooksAdvancedPage.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,22 @@ function QuickbooksAdvancedPage({policy}: WithPolicyConnectionsProps) {
102102
switchAccessibilityLabel: translate('workspace.qbo.advancedConfig.createEntitiesDescription'),
103103
isActive: !!autoCreateVendor,
104104
onToggle: (isOn) => {
105+
const autoCreateVendorKey = CONST.QUICK_BOOKS_CONFIG.AUTO_CREATE_VENDOR;
106+
const nonReimbursableVendorKey = CONST.QUICK_BOOKS_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR;
107+
const nonReimbursableVendorUpdateValue = isOn
108+
? policy?.connections?.quickbooksOnline?.data?.vendors?.[0]?.id ?? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE
109+
: CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE;
110+
const nonReimbursableVendorCurrentValue = nonReimbursableBillDefaultVendorObject?.id ?? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE;
111+
105112
QuickbooksOnline.updateQuickbooksOnlineAutoCreateVendor(
106113
policyID,
107114
{
108-
[CONST.QUICK_BOOKS_CONFIG.AUTO_CREATE_VENDOR]: isOn,
109-
[CONST.QUICK_BOOKS_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR]: isOn
110-
? policy?.connections?.quickbooksOnline?.data?.vendors?.[0]?.id ?? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE
111-
: CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE,
115+
[autoCreateVendorKey]: isOn,
116+
[nonReimbursableVendorKey]: nonReimbursableVendorUpdateValue,
112117
},
113118
{
114-
[CONST.QUICK_BOOKS_CONFIG.AUTO_CREATE_VENDOR]: autoCreateVendor,
115-
[CONST.QUICK_BOOKS_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR]: nonReimbursableBillDefaultVendorObject?.id ?? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE,
119+
[autoCreateVendorKey]: autoCreateVendor,
120+
[nonReimbursableVendorKey]: nonReimbursableVendorCurrentValue,
116121
},
117122
);
118123
},

0 commit comments

Comments
 (0)