File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
modules/@shopify/checkout-sheet-kit/src Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ export interface ShopifyCheckoutSheetKit {
308308 /**
309309 * Configure the checkout. See README.md for more details.
310310 */
311- setConfig ( config : Configuration ) : void ;
311+ setConfig ( config : Configuration ) : Promise < void > ;
312312 /**
313313 * Return the current config for the checkout. See README.md for more details.
314314 */
Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit {
8787 private features : Features ;
8888 private geolocationCallback : Maybe < EventSubscription > ;
8989
90+ private _acceleratedCheckoutsReady = false ;
91+
92+ get acceleratedCheckoutsReady ( ) : boolean {
93+ return this . _acceleratedCheckoutsReady ;
94+ }
95+
9096 /**
9197 * Initializes a new ShopifyCheckoutSheet instance
9298 * @param configuration Optional configuration settings for the checkout
@@ -156,7 +162,13 @@ class ShopifyCheckoutSheet implements ShopifyCheckoutSheetKit {
156162 * Updates the checkout configuration
157163 * @param configuration New configuration settings to apply
158164 */
159- public setConfig ( configuration : Configuration ) : void {
165+ public async setConfig ( configuration : Configuration ) : Promise < void > {
166+ if ( configuration . acceleratedCheckouts ) {
167+ this . _acceleratedCheckoutsReady =
168+ await this . configureAcceleratedCheckouts (
169+ configuration . acceleratedCheckouts ,
170+ ) ;
171+ }
160172 RNShopifyCheckoutSheetKit . setConfig ( configuration ) ;
161173 }
162174
You can’t perform that action at this time.
0 commit comments