Skip to content

Commit

Permalink
Merge pull request #811 from TrustlessComputer/fix/studio-aa
Browse files Browse the repository at this point in the history
fix aa module
  • Loading branch information
tonytc13579 authored Sep 23, 2024
2 parents e526cc3 + 8ad2235 commit 4b3789f
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 4b3789f

Please sign in to comment.