Skip to content

Commit

Permalink
Merge branch 'main' of generative:TrustlessComputer/bvm-website into …
Browse files Browse the repository at this point in the history
…0xd22f9c/ai-socket-connect
  • Loading branch information
jackie2111 committed Sep 23, 2024
2 parents d085af2 + 4b3789f commit 60ffbd1
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 60ffbd1

Please sign in to comment.