@@ -39,7 +39,7 @@ interface Context {
3939 acceleratedCheckoutsAvailable : boolean ;
4040 addEventListener : AddEventListener ;
4141 getConfig : ( ) => Promise < Configuration | undefined > ;
42- setConfig : ( config : Configuration ) => void ;
42+ setConfig : ( config : Configuration ) => Promise < void > ;
4343 removeEventListeners : RemoveEventListeners ;
4444 preload : ( checkoutUrl : string ) => void ;
4545 present : ( checkoutUrl : string ) => void ;
@@ -76,14 +76,10 @@ export function ShopifyCheckoutSheetProvider({
7676 return ;
7777 }
7878
79- if ( configuration . acceleratedCheckouts ) {
80- const ready = await instance . current ?. configureAcceleratedCheckouts (
81- configuration . acceleratedCheckouts ,
82- ) ;
83- setAcceleratedCheckoutsAvailable ( ready ) ;
84- }
85-
86- instance . current ?. setConfig ( configuration ) ;
79+ await instance . current ?. setConfig ( configuration ) ;
80+ setAcceleratedCheckoutsAvailable (
81+ instance . current . acceleratedCheckoutsReady ,
82+ ) ;
8783 }
8884
8985 configureCheckoutKit ( ) ;
@@ -120,8 +116,8 @@ export function ShopifyCheckoutSheetProvider({
120116 instance . current ?. dismiss ( ) ;
121117 } , [ ] ) ;
122118
123- const setConfig = useCallback ( ( config : Configuration ) => {
124- instance . current ?. setConfig ( config ) ;
119+ const setConfig = useCallback ( async ( config : Configuration ) => {
120+ await instance . current ?. setConfig ( config ) ;
125121 } , [ ] ) ;
126122
127123 const getConfig = useCallback ( async ( ) => {
0 commit comments