a
This commit is contained in:
parent
972694e98f
commit
ba818b480d
|
|
@ -451,11 +451,11 @@ const ConfigPanel = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 如果 accountId 变化了(不是初始化),刷新页面
|
// 如果 accountId 变化了(不是初始化),刷新页面
|
||||||
if (prevAccountIdRef.current !== null && prevAccountIdRef.current !== accountId) {
|
// if (prevAccountIdRef.current !== null && prevAccountIdRef.current !== accountId) {
|
||||||
// accountId 变化时,刷新页面以确保所有状态都正确更新
|
// // accountId 变化时,刷新页面以确保所有状态都正确更新
|
||||||
window.location.reload()
|
// window.location.reload()
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 初始化时,更新 ref 并加载数据
|
// 初始化时,更新 ref 并加载数据
|
||||||
prevAccountIdRef.current = accountId
|
prevAccountIdRef.current = accountId
|
||||||
|
|
@ -465,13 +465,13 @@ const ConfigPanel = () => {
|
||||||
loadAccountTradingStatus()
|
loadAccountTradingStatus()
|
||||||
loadCurrentAccountMeta(accountId)
|
loadCurrentAccountMeta(accountId)
|
||||||
|
|
||||||
// const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
// // 定时器中使用最新的 accountId
|
// 定时器中使用最新的 accountId
|
||||||
// loadAccountTradingStatus()
|
loadAccountTradingStatus()
|
||||||
// loadCurrentAccountMeta(accountId)
|
loadCurrentAccountMeta(accountId)
|
||||||
// }, 3000)
|
}, 3000)
|
||||||
|
|
||||||
// return () => clearInterval(timer)
|
return () => clearInterval(timer)
|
||||||
}, [accountId]) // 当 accountId 变化时,如果是切换账号则刷新页面
|
}, [accountId]) // 当 accountId 变化时,如果是切换账号则刷新页面
|
||||||
|
|
||||||
// 当accountId变化时,重新加载相关数据(避免重复调用,已在onChanged和定时器中处理)
|
// 当accountId变化时,重新加载相关数据(避免重复调用,已在onChanged和定时器中处理)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user