From 43c194b18ab4f5a748983934949e8d5b55ff194d Mon Sep 17 00:00:00 2001 From: Chika Date: Thu, 27 Jan 2022 13:03:08 +0300 Subject: [PATCH] calculationStore: fix subsidy reactions --- .../Effects/reactions/otherReactions.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts index a4398d0..adad752 100644 --- a/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts +++ b/src/client/stores/CalculationStore/Effects/reactions/otherReactions.ts @@ -1710,7 +1710,7 @@ const reactionEffects: IReactionEffect[] = [ brand, brand => - brand?.evo_vehicle_type && + brand?.evo_vehicle_type?.length && intersection( brand.evo_vehicle_type?.filter(x => x > 0), leaseObjectType.evo_vehicle_type, @@ -1719,7 +1719,7 @@ const reactionEffects: IReactionEffect[] = [ brand => brand && - (!subsidy?.evo_brands || + (!subsidy?.evo_brands?.length || subsidy?.evo_brands?.filter( x => x.evo_brandid === brand.evo_brandid, )?.length), @@ -1773,7 +1773,7 @@ const reactionEffects: IReactionEffect[] = [ calculationStore.setFilter('selectLeaseObjectType', types => types.filter( type => - !subsidy?.evo_leasingobject_types || + !subsidy?.evo_leasingobject_types?.length || subsidy.evo_leasingobject_types.filter( x => x.evo_leasingobject_typeid === type.evo_leasingobject_typeid, )?.length, @@ -1783,7 +1783,7 @@ const reactionEffects: IReactionEffect[] = [ calculationStore.setFilter('selectDealer', dealers => dealers.filter( dealer => - !subsidy?.accounts || + !subsidy?.accounts?.length || subsidy.accounts.filter(x => x.accountid === dealer.accountid) ?.length, ), @@ -1792,7 +1792,7 @@ const reactionEffects: IReactionEffect[] = [ calculationStore.setFilter('selectDealerPerson', dealerPersons => dealerPersons.filter( dealerPerson => - !subsidy?.accounts || + !subsidy?.accounts?.length || subsidy.accounts.filter(x => x.accountid === dealerPerson.accountid) ?.length, ),