From 08cf065575da387f47af27fb608ecd1118e2b93f Mon Sep 17 00:00:00 2001 From: Edie Lemoine Date: Wed, 4 Sep 2024 16:48:43 +0200 Subject: [PATCH] refactor: remove log statements --- views/frontend/checkout-core/src/main.ts | 2 -- .../frontend/checkout-delivery-options/src/main.ts | 13 ++++--------- .../src/utils/getHighestShippingClass.ts | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/views/frontend/checkout-core/src/main.ts b/views/frontend/checkout-core/src/main.ts index 8a8411864..6f2deed9e 100644 --- a/views/frontend/checkout-core/src/main.ts +++ b/views/frontend/checkout-core/src/main.ts @@ -56,8 +56,6 @@ createPdkCheckout({ const shippingClass = getHighestShippingClass(); - console.log(shippingClass, shippingMethods); - return shippingClass !== undefined && shippingMethods.includes(shippingClass); }, diff --git a/views/frontend/checkout-delivery-options/src/main.ts b/views/frontend/checkout-delivery-options/src/main.ts index 25776a68b..8d107bea0 100644 --- a/views/frontend/checkout-delivery-options/src/main.ts +++ b/views/frontend/checkout-delivery-options/src/main.ts @@ -1,14 +1,14 @@ import '../assets/scss/index.scss'; -import {defaultGetPackageType} from '@myparcel-pdk/checkout-delivery-options'; import { PdkDeliveryOptionsEvent, initializeCheckoutDeliveryOptions as initialize, useEvent, usePdkCheckout, - updateContext, useCheckoutStore, - getPackageTypeFromShippingMethod, StoreListener, + getPackageTypeFromShippingMethod, + defaultGetPackageType, + updateContext, } from '@myparcel-pdk/checkout'; import {getHighestShippingClass} from './utils'; @@ -20,18 +20,13 @@ const initializeCheckoutDeliveryOptions = () => { return; } - const context = await updateContext(); - - console.log('updated context:', context.settings.highestShippingClass); - console.log('getHighestShippingClass', getHighestShippingClass()); + await updateContext(); }); initialize({ getPackageType() { const shippingClass = getHighestShippingClass(); - console.log('getPackageType', shippingClass, shippingClass && getPackageTypeFromShippingMethod(shippingClass)); - return shippingClass ? getPackageTypeFromShippingMethod(shippingClass) : defaultGetPackageType(); }, }); diff --git a/views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts b/views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts index 5539e6727..b79567caf 100644 --- a/views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts +++ b/views/frontend/checkout-delivery-options/src/utils/getHighestShippingClass.ts @@ -3,7 +3,6 @@ import {useCheckoutStore} from '@myparcel-pdk/checkout'; export const getHighestShippingClass = (): undefined | string => { const checkout = useCheckoutStore(); - console.log(checkout.state.context.settings); // Empty string is a valid value, so we need to check for undefined return checkout.state.context.settings.highestShippingClass || undefined; };