Skip to content

Commit

Permalink
Get PAYMENT_STORE_KEY from global wc instead of importing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinamiko committed Dec 5, 2024
1 parent 4484386 commit a10000a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { registerPlugin } from '@wordpress/plugins';
import { useEffect, useCallback, useState, useRef } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { PAYMENT_STORE_KEY } from '@woocommerce/block-data';
import PayPalInsights from '../../../../ppcp-axo/resources/js/Insights/PayPalInsights';
import { STORE_NAME } from '../stores/axoStore';
import usePayPalCommerceGateway from '../hooks/usePayPalCommerceGateway';
Expand Down Expand Up @@ -149,6 +148,7 @@ const usePaymentMethodTracking = ( axoConfig, eventTracking ) => {
const isInitialMount = useRef( true );

const activePaymentMethod = useSelect( ( select ) => {
const { PAYMENT_STORE_KEY } = window.wc.wcBlocksData;
return select( PAYMENT_STORE_KEY )?.getActivePaymentMethod();
}, [] );

Expand Down

0 comments on commit a10000a

Please sign in to comment.