서버 알림목록 오류 수정
This commit is contained in:
@@ -184,10 +184,25 @@ export const TradeNotificationListPage: React.FC<Props> = ({
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
void prefetchNotificationStrategies().then(list => {
|
||||
if (!cancelled) setStrategies(list);
|
||||
});
|
||||
return () => { cancelled = true; };
|
||||
let retryTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
const load = () => {
|
||||
void prefetchNotificationStrategies().then(list => {
|
||||
if (cancelled) return;
|
||||
if (list.length > 0) {
|
||||
setStrategies(list);
|
||||
} else {
|
||||
// 백엔드 미준비(Docker 기동 초기)로 빈 목록이 반환된 경우 5초 후 재시도
|
||||
retryTimer = setTimeout(load, 5000);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
load();
|
||||
return () => {
|
||||
cancelled = true;
|
||||
if (retryTimer) clearTimeout(retryTimer);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const tradePrice = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user