Removed test action.

This commit is contained in:
Tom Butcher 2025-08-30 23:39:10 +01:00
parent c38ed74f21
commit 2b092cb846

View File

@ -1,6 +1,6 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { useContext, useEffect, useState, useRef } from 'react' import { useContext, useEffect, useState, useRef } from 'react'
import { Input, Result, Typography, Flex, Progress, Button } from 'antd' import { Input, Result, Typography, Flex, Progress } from 'antd'
import { LoadingOutlined } from '@ant-design/icons' import { LoadingOutlined } from '@ant-design/icons'
import { ApiServerContext } from '../../context/ApiServerContext' import { ApiServerContext } from '../../context/ApiServerContext'
import CopyButton from '../../common/CopyButton' import CopyButton from '../../common/CopyButton'
@ -9,7 +9,7 @@ import OTPIcon from '../../../Icons/OTPIcon'
const { Text } = Typography const { Text } = Typography
const HostOTP = ({ id }) => { const HostOTP = ({ id }) => {
const { fetchHostOTP, sendObjectAction } = useContext(ApiServerContext) const { fetchHostOTP } = useContext(ApiServerContext)
const [hostObject, setHostObject] = useState(null) const [hostObject, setHostObject] = useState(null)
const [loading, setLoading] = useState(true) const [loading, setLoading] = useState(true)
const [timeRemaining, setTimeRemaining] = useState(0) const [timeRemaining, setTimeRemaining] = useState(0)
@ -35,13 +35,6 @@ const HostOTP = ({ id }) => {
}) })
} }
const sendTestAction = () => {
console.log('Sending test action...')
sendObjectAction(id, 'host', { method: 'testMethod' }, (result) => {
console.log('Got callback', result)
})
}
useEffect(() => { useEffect(() => {
if (hostObject === null && initialized == false) { if (hostObject === null && initialized == false) {
setInitialized(true) setInitialized(true)
@ -85,7 +78,6 @@ const HostOTP = ({ id }) => {
return ( return (
<Flex vertical align='center'> <Flex vertical align='center'>
<Button onClick={sendTestAction}>Test Action</Button>
<Result <Result
title={'Connect a Host.'} title={'Connect a Host.'}
subTitle={<Text>Enter the following one time passcode.</Text>} subTitle={<Text>Enter the following one time passcode.</Text>}