From 24987be78e2a8a051e76af9ec9b9ef9cbffc320a Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 29 Feb 2024 16:06:15 +0300 Subject: [PATCH] apps/web: fix telematic/tracker reaction --- apps/web/process/add-product/reactions.ts | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/apps/web/process/add-product/reactions.ts b/apps/web/process/add-product/reactions.ts index 37a9087..3e4b48b 100644 --- a/apps/web/process/add-product/reactions.ts +++ b/apps/web/process/add-product/reactions.ts @@ -302,37 +302,37 @@ export default function reactions({ store, apolloClient }: ProcessContext) { filteredTelematicTypes = filteredTelematicTypes?.filter( (x) => x?.evo_visible_calc === true ); - } - if (engineType === 100_000_003) { - filteredTelematicTypes = telematicTypes?.filter( - (x) => - x?.evo_controls_program?.includes(100_000_003) && - x.label?.toLowerCase().includes('аво') && - !x.label?.toLowerCase().includes('pro') - ); + if (engineType === 100_000_003) { + filteredTelematicTypes = telematicTypes?.filter( + (x) => + x?.evo_controls_program?.includes(100_000_003) && + x.label?.toLowerCase().includes('аво') && + !x.label?.toLowerCase().includes('pro') + ); - $calculation.element('selectTracker').resetValue().block(); - $calculation.element('selectTelematic').block(); - } else { - $calculation.element('selectTracker').unblock(); - $calculation.element('selectTelematic').unblock(); + $calculation.element('selectTracker').resetValue().block(); + $calculation.element('selectTelematic').block(); + } else { + $calculation.element('selectTracker').unblock(); + $calculation.element('selectTelematic').unblock(); - if (leaseObjectTypeId) { - const { - data: { evo_leasingobject_type }, - } = await apolloClient.query({ - query: CRMTypes.GetLeaseObjectTypeDocument, - variables: { leaseObjectTypeId }, - }); + if (leaseObjectTypeId) { + const { + data: { evo_leasingobject_type }, + } = await apolloClient.query({ + query: CRMTypes.GetLeaseObjectTypeDocument, + variables: { leaseObjectTypeId }, + }); - if (evo_leasingobject_type?.evo_id === '11') { - filteredTelematicTypes = telematicTypes?.filter( - (x) => - x?.evo_controls_program?.includes(100_000_002) && - x.label?.toLowerCase().includes('delta') && - !x.label?.toLowerCase().includes('pro') - ); + if (evo_leasingobject_type?.evo_id === '11') { + filteredTelematicTypes = telematicTypes?.filter( + (x) => + x?.evo_controls_program?.includes(100_000_002) && + x.label?.toLowerCase().includes('delta') && + !x.label?.toLowerCase().includes('pro') + ); + } } } }