diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index b97c6c8..c62274d 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -13,7 +13,6 @@ import { useAgentStore } from './store/agentStore'; import { useMarketStore } from './store/marketStore'; import { usePortfolioStore } from './store/portfolioStore'; import { useRuntimeStore } from './store/runtimeStore'; -import { useOpenClawStore } from './store/openclawStore'; import { useUIStore } from './store/uiStore'; const EDITABLE_AGENT_WORKSPACE_FILES = [ @@ -139,11 +138,6 @@ export default function LiveTradingApp() { addSystemMessage, }); - // Make clientRef available to OpenClaw panel via store - useEffect(() => { - useOpenClawStore.getState().setClientRef(clientRef); - }, [clientRef]); - const runtimeControls = useRuntimeControls({ clientRef, currentTickers: tickers, diff --git a/frontend/src/components/AppShell.jsx b/frontend/src/components/AppShell.jsx index 3387d0b..7c7fab2 100644 --- a/frontend/src/components/AppShell.jsx +++ b/frontend/src/components/AppShell.jsx @@ -13,7 +13,6 @@ const AgentFeed = lazy(() => import('./AgentFeed')); const StatisticsView = lazy(() => import('./StatisticsView')); const StockExplainView = lazy(() => import('./StockExplainView.jsx')); const TraderView = lazy(() => import('./TraderView.jsx')); -const OpenClawView = lazy(() => import('./OpenClawView.jsx')); function ViewLoadingFallback({ label = '加载中...' }) { return ( @@ -137,6 +136,12 @@ export default function AppShell({ const { setIsRuntimeSettingsOpen, setIsWatchlistPanelOpen } = useRuntimeStore(); const { setChartTab, setCurrentView, setIsResizing, setLeftWidth } = useUIStore(); + useEffect(() => { + if (currentView === 'openclaw') { + setCurrentView('statistics'); + } + }, [currentView, setCurrentView]); + // Resize handler useEffect(() => { if (!isResizing) return; @@ -172,7 +177,7 @@ export default function AppShell({ currentView === 'room' ? 'show-room' : currentView === 'explain' ? 'show-explain' : currentView === 'chart' ? 'show-chart' : - currentView === 'statistics' ? 'show-statistics' : 'show-openclaw'}`; + 'show-statistics'}`; return base; }, [currentView]); @@ -382,12 +387,6 @@ export default function AppShell({ > 统计 -