From 8ad22356e5e375250a0808a6a04c420289884275 Mon Sep 17 00:00:00 2001 From: tony Date: Mon, 23 Sep 2024 15:40:46 +0700 Subject: [PATCH] fix aa module --- .../enhance.loopFetchIssueTokenList.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) 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 ; };