mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01:00
fix(ui): ref issue in benchmark page
This commit is contained in:
parent
a4de8d05f7
commit
8e84ece2ef
|
|
@ -40,7 +40,7 @@ export default function BenchmarkPage(props: {
|
||||||
const aiInstalled = useServiceInstalledStatus(SERVICE_NAMES.OLLAMA)
|
const aiInstalled = useServiceInstalledStatus(SERVICE_NAMES.OLLAMA)
|
||||||
const [progress, setProgress] = useState<BenchmarkProgressWithID | null>(null)
|
const [progress, setProgress] = useState<BenchmarkProgressWithID | null>(null)
|
||||||
const [isRunning, setIsRunning] = useState(props.benchmark.status !== 'idle')
|
const [isRunning, setIsRunning] = useState(props.benchmark.status !== 'idle')
|
||||||
const refetchLatestRef = useRef(refetchLatest)
|
const refetchLatestRef = useRef<(() => void) | null>(null)
|
||||||
const [showDetails, setShowDetails] = useState(false)
|
const [showDetails, setShowDetails] = useState(false)
|
||||||
const [showHistory, setShowHistory] = useState(false)
|
const [showHistory, setShowHistory] = useState(false)
|
||||||
const [showAIRequiredAlert, setShowAIRequiredAlert] = useState(false)
|
const [showAIRequiredAlert, setShowAIRequiredAlert] = useState(false)
|
||||||
|
|
@ -308,7 +308,7 @@ export default function BenchmarkPage(props: {
|
||||||
setProgress(data)
|
setProgress(data)
|
||||||
if (data.status === 'completed' || data.status === 'error') {
|
if (data.status === 'completed' || data.status === 'error') {
|
||||||
setIsRunning(false)
|
setIsRunning(false)
|
||||||
refetchLatestRef.current()
|
refetchLatestRef.current?.()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user