테블릿 로딩 이슈 수정
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user