Skip to content

Commit 70d5e0c

Browse files
Refactored check to use some as the previous method would have always been false
1 parent 9554af9 commit 70d5e0c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

client/components/mma/delivery/address/DeliveryAddressForm.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import { NAV_LINKS } from '../../../shared/nav/NavConfig';
2828
import { COUNTRIES } from '../../identity/models';
2929
import { InfoIconDark } from '../../shared/assets/InfoIconDark';
3030
import { InfoSection } from '../../shared/InfoSection';
31-
import { ProductDescriptionListTable } from '../../shared/ProductDescriptionListTable';
3231
import type { ProductDescriptionListKeyValue } from '../../shared/ProductDescriptionListTable';
32+
import { ProductDescriptionListTable } from '../../shared/ProductDescriptionListTable';
3333
import { ProgressIndicator } from '../../shared/ProgressIndicator';
3434
import type { AddressSetStateObject } from './DeliveryAddressFormContext';
3535
import {
@@ -438,13 +438,17 @@ export const DeliveryAddressUpdate = (props: WithProductType<ProductType>) => {
438438
contactIdToArrayOfProductDetailAndProductType,
439439
)
440440
.flatMap(flattenEquivalent)
441-
.map(({ productDetail }) => {
442-
const hasProducts = GROUPED_PRODUCT_TYPES.subscriptions
441+
.some(({ productDetail }) => {
442+
console.log(productDetail);
443+
return GROUPED_PRODUCT_TYPES.subscriptions
443444
.mapGroupedToSpecific(productDetail)
444-
.productType.includes('national delivery');
445-
return `${hasProducts}`;
445+
.productType.includes('nationaldelivery');
446446
});
447447

448+
console.log(contactIdToArrayOfProductDetailAndProductType);
449+
450+
console.log(hasNationalDelivery);
451+
448452
if (hasNationalDelivery) {
449453
return (
450454
<>

0 commit comments

Comments
 (0)