Skip to content

Commit

Permalink
update pendingActions
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Oct 17, 2024
1 parent fa57318 commit 8cf9bf0
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function QuickbooksDesktopCompanyCardExpenseAccountPage({policy}: WithPolicyConn
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID))}
>
{sections.map((section) => (
<OfflineWithFeedback pendingAction={PolicyUtils.settingsPendingAction(section.subscribedSettings, qbdConfig?.pendingFields)}>
<OfflineWithFeedback
key={section.keyForList}
pendingAction={PolicyUtils.settingsPendingAction(section.subscribedSettings, qbdConfig?.pendingFields)}
>
<MenuItemWithTopDescription
title={section.title}
description={section.description}
Expand All @@ -86,14 +89,20 @@ function QuickbooksDesktopCompanyCardExpenseAccountPage({policy}: WithPolicyConn
switchAccessibilityLabel={translate('workspace.qbd.defaultVendorDescription')}
wrapperStyle={[styles.ph5, styles.mb3, styles.mt1]}
isActive={!!qbdConfig?.shouldAutoCreateVendor}
pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR], qbdConfig?.pendingFields)}
pendingAction={PolicyUtils.settingsPendingAction(
[CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE],
qbdConfig?.pendingFields,
)}
errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR)}
onToggle={(isOn) => QuickbooksDesktop.updateQuickbooksDesktopShouldAutoCreateVendor(policyID, isOn)}
onCloseError={() => clearQBDErrorField(policyID, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR)}
/>
{!!qbdConfig?.shouldAutoCreateVendor && (
<OfflineWithFeedback
pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR], qbdConfig?.pendingFields)}
pendingAction={PolicyUtils.settingsPendingAction(
[CONST.QUICKBOOKS_DESKTOP_CONFIG.NON_REIMBURSABLE_BILL_DEFAULT_VENDOR, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR],
qbdConfig?.pendingFields,
)}
>
<MenuItemWithTopDescription
title={nonReimbursableBillDefaultVendorObject?.name}
Expand Down

0 comments on commit 8cf9bf0

Please sign in to comment.