diff --git a/src/modules/blockchains/detail_v4/enhance/enhance.loopFetchIssueTokenList.tsx b/src/modules/blockchains/detail_v4/enhance/enhance.loopFetchIssueTokenList.tsx index 626fd1adc..1309c9e06 100644 --- a/src/modules/blockchains/detail_v4/enhance/enhance.loopFetchIssueTokenList.tsx +++ b/src/modules/blockchains/detail_v4/enhance/enhance.loopFetchIssueTokenList.tsx @@ -1,30 +1,31 @@ import { useEffect } from 'react'; import { useDAServicesHelper } from '../hook/useDAServicesHelper'; +import { useAppSelector } from '@/stores/hooks'; +import { getL2ServicesStateSelector } from '@/stores/states/l2services/selector'; const enhanceLoopFetchIssueTokenList = (WrappedComponent: any) => (props: any) => { - const { chainDetailData } = props; - + // const { chainDetailData, orderId } = props; + const { orderDetail } = useAppSelector(getL2ServicesStateSelector); const { loopFetchTokenIssueList, clearLoopFetchTokenIssueList } = useDAServicesHelper(); useEffect(() => { - // console.log( - // '--- enhanceLoopFetchIssueTokenList useEffect START --- ', - // chainDetailData, - // ); - - if (chainDetailData && chainDetailData.chainId) { - loopFetchTokenIssueList(chainDetailData?.chainId); + // console.log('[enhanceLoopFetchIssueTokenList] useEffect START --- ', { + // chainID: orderDetail?.chainId, + // orderId: orderDetail?.orderId, + // }); + if (orderDetail && orderDetail.chainId) { + loopFetchTokenIssueList(orderDetail.chainId); } else { clearLoopFetchTokenIssueList(); } return () => { - console.log('--- enhanceLoopFetchIssueTokenList useEffect END --- '); + console.log('[enhanceLoopFetchIssueTokenList] useEffect END --- '); clearLoopFetchTokenIssueList(); }; - }, []); + }, [orderDetail]); return ; };