차트 설정 수정

This commit is contained in:
Macbook
2026-06-01 01:35:31 +09:00
parent 332019866a
commit f2208aab99
28 changed files with 546 additions and 333 deletions
+15 -10
View File
@@ -1,4 +1,11 @@
import { loadStrategy, loadStrategyTimeframes, repairStrategyTimeframes, saveStrategy, type StrategyDto } from './backendApi';
import {
isStrategyMissingOnServer,
loadStrategy,
loadStrategyTimeframes,
repairStrategyTimeframes,
saveStrategy,
type StrategyDto,
} from './backendApi';
import {
alignBuySellStartCandleTypesForSave,
collectDslBranches,
@@ -143,9 +150,10 @@ function buildEditorStateFromStrategy(
*/
export async function syncStrategyTimeframesFromLayoutIfNeeded(
strategyId: number,
strategy?: StrategyDto | null,
_strategy?: StrategyDto | null,
): Promise<boolean> {
const strat = (await loadStrategy(strategyId)) ?? strategy ?? null;
if (isStrategyMissingOnServer(strategyId)) return false;
const strat = await loadStrategy(strategyId);
if (!strat) return false;
const uiTfs = collectUiEvaluationTimeframes(strategyId, strat);
@@ -162,13 +170,10 @@ export async function syncStrategyTimeframesFromLayoutIfNeeded(
const layout = strat.flowLayout;
if (!layout) {
try {
await repairStrategyTimeframes(strategyId);
const repaired = await loadStrategyTimeframes(strategyId);
return evaluationTimeframesMatch(uiTfs, repaired);
} catch {
return false;
}
const repaired = await repairStrategyTimeframes(strategyId);
if (!repaired) return false;
const tfs = await loadStrategyTimeframes(strategyId);
return evaluationTimeframesMatch(uiTfs, tfs);
}
const buyState = buildEditorStateFromStrategy(strat, layout, 'buy');