From 55555828c7f28ee06a36d69d30d9c027b3ed84b5 Mon Sep 17 00:00:00 2001 From: Yauheni Date: Fri, 18 Oct 2024 15:49:49 +0200 Subject: [PATCH] remove condition for enablePolicyTaxes --- .../qbd/QuickBooksDesktopSetupPage.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx index 60a91db47395..1aa80231fc7d 100644 --- a/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx +++ b/src/pages/workspace/accounting/qbd/QuickBooksDesktopSetupPage.tsx @@ -1,3 +1,4 @@ +import type {StackScreenProps} from '@react-navigation/stack'; import React, {useEffect, useState} from 'react'; import {View} from 'react-native'; import Computer from '@assets/images/laptop-with-second-screen-sync.svg'; @@ -12,16 +13,18 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as QuickbooksDesktop from '@libs/actions/connections/QuickbooksDesktop'; import Navigation from '@libs/Navigation/Navigation'; +import type {SettingsNavigatorParamList} from '@libs/Navigation/types'; import LoadingPage from '@pages/LoadingPage'; -import withPolicy from '@pages/workspace/withPolicy'; -import type {WithPolicyProps} from '@pages/workspace/withPolicy'; import * as PolicyAction from '@userActions/Policy/Policy'; import ROUTES from '@src/ROUTES'; +import type SCREENS from '@src/SCREENS'; -function RequireQuickBooksDesktopModal({policy}: WithPolicyProps) { +type RequireQuickBooksDesktopModalProps = StackScreenProps; + +function RequireQuickBooksDesktopModal({route}: RequireQuickBooksDesktopModalProps) { const {translate} = useLocalize(); const styles = useThemeStyles(); - const policyID = policy?.id ?? '-1'; + const policyID: string = route.params.policyID; const [isLoading, setIsLoading] = useState(true); const [codatSetupLink, setCodatSetupLink] = useState(''); @@ -35,9 +38,7 @@ function RequireQuickBooksDesktopModal({policy}: WithPolicyProps) { }; // Since QBD doesn't support Taxes, we should disable them from the LHN when connecting to QBD - if (policy?.tax?.trackingEnabled) { - PolicyAction.enablePolicyTaxes(policyID, false); - } + PolicyAction.enablePolicyTaxes(policyID, false); fetchSetupLink(); // disabling this rule, as we want this to run only on the first render @@ -88,4 +89,4 @@ function RequireQuickBooksDesktopModal({policy}: WithPolicyProps) { RequireQuickBooksDesktopModal.displayName = 'RequireQuickBooksDesktopModal'; -export default withPolicy(RequireQuickBooksDesktopModal); +export default RequireQuickBooksDesktopModal;