apps/web: fix telematic/tracker reaction

This commit is contained in:
vchikalkin 2024-02-29 16:06:15 +03:00
parent defc625324
commit 24987be78e

View File

@ -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')
);
}
}
}
}