테블릿 로딩 이슈 수정

This commit is contained in:
Macbook
2026-05-31 23:44:31 +09:00
parent a34b49c23a
commit 332019866a
7 changed files with 78 additions and 15 deletions
@@ -5,7 +5,7 @@ import React, { useState, useCallback, useEffect, useMemo, useRef } from 'react'
import { ReactFlowProvider } from '@xyflow/react';
import DraggableModalFrame from './DraggableModalFrame';
import type { Theme } from '../types/index';
import { loadStrategies, loadStrategy, saveStrategy, deleteStrategy, type StrategyDto as ApiStrategyDto } from '../utils/backendApi';
import { hasRegisteredUser, loadStrategies, loadStrategy, saveStrategy, deleteStrategy, type StrategyDto as ApiStrategyDto } from '../utils/backendApi';
import { syncStrategyTimeframesFromLayoutIfNeeded } from '../utils/strategyTimeframeSync';
import type { LogicNode } from '../utils/strategyTypes';
import {
@@ -512,6 +512,7 @@ export default function StrategyEditorPage({ theme }: Props) {
useEffect(() => { saveStratsLocal(strategies); }, [strategies]);
useEffect(() => {
if (!hasRegisteredUser()) return;
loadStrategies().then(async list => {
if (list?.length) {
setStrategies(list.map(s => ({
@@ -647,6 +648,9 @@ export default function StrategyEditorPage({ theme }: Props) {
// flow layout START 분봉이 DB DSL보다 최신이면 서버에 반영 (실시간 평가는 DB 기준)
void (async () => {
if (!hasRegisteredUser() || s.id == null) return;
const exists = await loadStrategy(s.id);
if (!exists) return;
const synced = await syncStrategyTimeframesFromLayoutIfNeeded(s.id, { ...s, flowLayout: stored ?? s.flowLayout });
if (!synced) return;
try {