diff --git a/views/js/frontend/checkout/src/deliveryOptions/listeners/updateCheckoutOnUpdate.ts b/views/js/frontend/checkout/src/deliveryOptions/listeners/updateCheckoutOnUpdate.ts index 16101c4c..4b14dc81 100644 --- a/views/js/frontend/checkout/src/deliveryOptions/listeners/updateCheckoutOnUpdate.ts +++ b/views/js/frontend/checkout/src/deliveryOptions/listeners/updateCheckoutOnUpdate.ts @@ -1,14 +1,14 @@ -import {debounce, type DeliveryOptionsStoreState, type StoreCallbackUpdate} from '@myparcel-pdk/checkout'; +import { + debounce, + useDeliveryOptionsStore, + type DeliveryOptionsStoreState, + type StoreCallbackUpdate, +} from '@myparcel-pdk/checkout'; import {objectIsEqual} from '@myparcel/ts-utils'; import {getCurrentShippingMethod} from '../../utils'; const CHECKOUT_UPDATE_DELAY = 200; -/** - * Only do this once to avoid excessive animations. - */ -let done = false; - export const onDeliveryOptionsOutputChange: StoreCallbackUpdate = debounce( (newState, oldState) => { if (objectIsEqual(newState.output, oldState?.output)) { @@ -21,13 +21,12 @@ export const onDeliveryOptionsOutputChange: StoreCallbackUpdate