mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-06-30 09:31:19 +08:00
fix: 修复 showBinanceGuide 状态作用域错误
- 从父组件 AITradersPage 移除未使用的状态声明(第54行)
- 在子组件 ExchangeConfigModal 内添加本地状态(第1176行)
- 修复 TypeScript 编译错误(TS6133, TS2304)
问题:状态在父组件声明但在子组件使用,导致跨作用域引用错误
影响:前端编译失败,Docker build 报错
解决:将状态声明移至实际使用的子组件内
Related: PR #467, commit 072f314
This commit is contained in:
@@ -51,7 +51,6 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) {
|
||||
coinPoolUrl: '',
|
||||
oiTopUrl: ''
|
||||
});
|
||||
const [showBinanceGuide, setShowBinanceGuide] = useState(false);
|
||||
|
||||
const { data: traders, mutate: mutateTraders } = useSWR<TraderInfo[]>(
|
||||
'traders',
|
||||
@@ -1172,7 +1171,10 @@ function ExchangeConfigModal({
|
||||
const [secretKey, setSecretKey] = useState('');
|
||||
const [passphrase, setPassphrase] = useState('');
|
||||
const [testnet, setTestnet] = useState(false);
|
||||
|
||||
|
||||
// 币安配置指南展开状态
|
||||
const [showBinanceGuide, setShowBinanceGuide] = useState(false);
|
||||
|
||||
// Hyperliquid 特定字段
|
||||
const [hyperliquidWalletAddr, setHyperliquidWalletAddr] = useState('');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user