Fix bot list

This commit is contained in:
2025-10-10 14:30:58 +07:00
parent b6b11be33a
commit de8160e533

View File

@@ -2,7 +2,7 @@ import {ChartBarIcon, CogIcon, EyeIcon, PlayIcon, PlusCircleIcon, StopIcon, Tras
import React, {useState} from 'react'
import useApiUrlStore from '../../app/store/apiStore'
import {useIsBotOwner} from '../../app/store/userStore'
import {useCurrentUser} from '../../app/store/userStore'
import {CardPosition, CardSignal, CardText, Toast,} from '../../components/mollecules'
import ManualPositionModal from '../../components/mollecules/ManualPositionModal'
import TradesModal from '../../components/mollecules/TradesModal/TradesModal'
@@ -52,8 +52,13 @@ const BotList: React.FC<IBotList> = ({ list }) => {
const { apiUrl } = useApiUrlStore()
const client = new BotClient({}, apiUrl)
// Use the new user store hook for bot ownership checking
const checkIsBotOwner = useIsBotOwner
// Call the hook at the top level
const { user } = useCurrentUser()
// Use the user data for bot ownership checking
const checkIsBotOwner = (botAgentName: string) => {
return user?.agentName === botAgentName
}
const [showMoneyManagementModal, setShowMoneyManagementModal] =
useState(false)