Skip to content

Commit

Permalink
fix aa module
Browse files Browse the repository at this point in the history
  • Loading branch information
tonytc13579 committed Sep 23, 2024
1 parent e526cc3 commit 8ad2235
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -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 <WrappedComponent {...props} />;
};
Expand Down

0 comments on commit 8ad2235

Please sign in to comment.