From de8160e53307f316c1ef6e612c8fd83b2be06df9 Mon Sep 17 00:00:00 2001 From: cryptooda Date: Fri, 10 Oct 2025 14:30:58 +0700 Subject: [PATCH] Fix bot list --- src/Managing.WebApp/src/pages/botsPage/botList.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Managing.WebApp/src/pages/botsPage/botList.tsx b/src/Managing.WebApp/src/pages/botsPage/botList.tsx index c06ac691..1de57ad6 100644 --- a/src/Managing.WebApp/src/pages/botsPage/botList.tsx +++ b/src/Managing.WebApp/src/pages/botsPage/botList.tsx @@ -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 = ({ 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)