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