알림목록 오류 수정
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
resolveNotificationStrategy,
|
resolveNotificationStrategy,
|
||||||
normalizeStrategyId,
|
normalizeStrategyId,
|
||||||
} from '../utils/resolveNotificationStrategy';
|
} from '../utils/resolveNotificationStrategy';
|
||||||
|
import { isStrategyMissingOnServer } from '../utils/strategyMissingCache';
|
||||||
import { hydrateStrategyDto, normalizeMarketCode } from '../utils/strategyHydrate';
|
import { hydrateStrategyDto, normalizeMarketCode } from '../utils/strategyHydrate';
|
||||||
import {
|
import {
|
||||||
fetchLiveSnapshot,
|
fetchLiveSnapshot,
|
||||||
@@ -61,6 +62,12 @@ export function useTradeNotificationSignalSnapshot(
|
|||||||
emptyRetryRef.current = 0;
|
emptyRetryRef.current = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 서버에 없는 것으로 확인된 전략은 재요청하지 않음
|
||||||
|
if (isStrategyMissingOnServer(rawId)) {
|
||||||
|
setSnapshot(undefined);
|
||||||
|
setLoading(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (refreshInFlightRef.current) return;
|
if (refreshInFlightRef.current) return;
|
||||||
|
|
||||||
const gen = ++genRef.current;
|
const gen = ++genRef.current;
|
||||||
|
|||||||
@@ -7,7 +7,11 @@ import {
|
|||||||
loadStrategyForNotification,
|
loadStrategyForNotification,
|
||||||
type StrategyDto,
|
type StrategyDto,
|
||||||
} from './backendApi';
|
} from './backendApi';
|
||||||
import { reconcileStrategyMissingWithValidIds, unmarkStrategyMissingOnServer } from './strategyMissingCache';
|
import {
|
||||||
|
isStrategyMissingOnServer,
|
||||||
|
reconcileStrategyMissingWithValidIds,
|
||||||
|
unmarkStrategyMissingOnServer,
|
||||||
|
} from './strategyMissingCache';
|
||||||
import { coerceFiniteNumber } from './safeFormat';
|
import { coerceFiniteNumber } from './safeFormat';
|
||||||
import { hydrateStrategyDto, normalizeMarketCode } from './strategyHydrate';
|
import { hydrateStrategyDto, normalizeMarketCode } from './strategyHydrate';
|
||||||
import { extractVirtualConditions } from './virtualStrategyConditions';
|
import { extractVirtualConditions } from './virtualStrategyConditions';
|
||||||
@@ -77,12 +81,14 @@ export async function resolveNotificationStrategy(
|
|||||||
if (fromList?.id != null && hasExtractableConditions(fromList)) {
|
if (fromList?.id != null && hasExtractableConditions(fromList)) {
|
||||||
return pickStrategy(fromList, normalizedId);
|
return pickStrategy(fromList, normalizedId);
|
||||||
}
|
}
|
||||||
const loaded = await loadStrategyForNotification(normalizedId);
|
if (!isStrategyMissingOnServer(normalizedId)) {
|
||||||
if (loaded && extractVirtualConditions(loaded).length > 0) {
|
const loaded = await loadStrategyForNotification(normalizedId);
|
||||||
return { strategy: loaded, strategyId: normalizedId };
|
if (loaded && extractVirtualConditions(loaded).length > 0) {
|
||||||
}
|
return { strategy: loaded, strategyId: normalizedId };
|
||||||
if (loaded) {
|
}
|
||||||
return { strategy: loaded, strategyId: normalizedId };
|
if (loaded) {
|
||||||
|
return { strategy: loaded, strategyId: normalizedId };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,9 +99,11 @@ export async function resolveNotificationStrategy(
|
|||||||
if (hasExtractableConditions(byName)) {
|
if (hasExtractableConditions(byName)) {
|
||||||
return pickStrategy(byName, byName.id);
|
return pickStrategy(byName, byName.id);
|
||||||
}
|
}
|
||||||
const loaded = await loadStrategyForNotification(byName.id);
|
if (!isStrategyMissingOnServer(byName.id)) {
|
||||||
if (loaded) {
|
const loaded = await loadStrategyForNotification(byName.id);
|
||||||
return { strategy: loaded, strategyId: byName.id };
|
if (loaded) {
|
||||||
|
return { strategy: loaded, strategyId: byName.id };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user