평가로직 오류 수정

This commit is contained in:
Macbook
2026-06-17 23:57:17 +09:00
parent d4b5814bbc
commit 9c832a3ab8
7 changed files with 156 additions and 27 deletions
+6 -4
View File
@@ -45,15 +45,17 @@ export function hydrateStrategyDto(strategy: StrategyDto): StrategyDto {
if (!layout) return next;
try {
const buyState = decodeConditionForEditor(buy);
const sellState = decodeConditionForEditor(sell);
const normalizedBuy = asLogicNode(next.buyCondition);
const normalizedSell = asLogicNode(next.sellCondition);
const buyState = decodeConditionForEditor(normalizedBuy);
const sellState = decodeConditionForEditor(normalizedSell);
const encodedBuy = encodeConditionForSave(buyState);
const encodedSell = encodeConditionForSave(sellState);
if (encodedBuy || encodedSell) {
next = {
...next,
buyCondition: encodedBuy ?? buy ?? undefined,
sellCondition: encodedSell ?? sell ?? undefined,
buyCondition: encodedBuy ?? normalizedBuy ?? undefined,
sellCondition: encodedSell ?? normalizedSell ?? undefined,
};
}
} catch {