Skip to content

Commit

Permalink
fix(checkout): retain specific configs when switching carriers
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Nov 9, 2023
1 parent 2270271 commit 3d3c223
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
};

0 comments on commit 3d3c223

Please sign in to comment.