서버 알림목록 오류 수정

This commit is contained in:
Macbook
2026-06-11 01:30:15 +09:00
parent 979c0da47a
commit 66143e5912
3 changed files with 37 additions and 14 deletions
@@ -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(