diff --git a/plugins/woocommerce-blocks/assets/js/data/checkout/index.ts b/plugins/woocommerce-blocks/assets/js/data/checkout/index.ts index ada043213e5..53efeae667b 100644 --- a/plugins/woocommerce-blocks/assets/js/data/checkout/index.ts +++ b/plugins/woocommerce-blocks/assets/js/data/checkout/index.ts @@ -36,14 +36,14 @@ const isEditor = !! wpDataSelect( 'core/editor' ); // This is needed to ensure that the payment methods are displayed in the editor if ( isEditor ) { - subscribe( async () => { + const unsubscribeEditor = subscribe( async () => { await checkPaymentMethodsCanPay(); await checkPaymentMethodsCanPay( true ); } ); const unsubscribeInitializePaymentStore = subscribe( async () => { wpDataDispatch( 'wc/store/payment' ).__internalInitializePaymentStore(); - + unsubscribeEditor(); unsubscribeInitializePaymentStore(); } ); }