diff --git a/views/js/frontend/checkout-delivery-options/src/functions/getDefaultDeliveryOptionsConfig.ts b/views/js/frontend/checkout-delivery-options/src/functions/getDefaultDeliveryOptionsConfig.ts index c3fd5d80..20b8d6a9 100644 --- a/views/js/frontend/checkout-delivery-options/src/functions/getDefaultDeliveryOptionsConfig.ts +++ b/views/js/frontend/checkout-delivery-options/src/functions/getDefaultDeliveryOptionsConfig.ts @@ -1,7 +1,13 @@ import {useDeliveryOptionsStore, type DeliveryOptionsConfiguration} from '@myparcel-pdk/checkout'; +let configuration: DeliveryOptionsConfiguration | undefined; + export const getDefaultDeliveryOptionsConfig = (): DeliveryOptionsConfiguration => { - const deliveryOptionsStore = useDeliveryOptionsStore(); + if (!configuration) { + const deliveryOptionsStore = useDeliveryOptionsStore(); + + configuration = deliveryOptionsStore.state.configuration; + } - return deliveryOptionsStore.state.configuration; + return configuration; };