ммммм
This commit is contained in:
parent
6259916170
commit
b3ea9d84cb
1 changed files with 12 additions and 3 deletions
|
|
@ -178,9 +178,18 @@ export function ObjectDetailPage({ defaultMode = 'inventory' }: { defaultMode?:
|
||||||
const discoveryRunning = discoverMutation.isPending || !!discoveryTaskId || !!discoveryStatus.data?.running
|
const discoveryRunning = discoverMutation.isPending || !!discoveryTaskId || !!discoveryStatus.data?.running
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (discoveryStatus.data?.running && !discoveryOpen) {
|
const statusTaskId = discoveryStatus.data?.task_id
|
||||||
setDiscoveryTaskId(discoveryStatus.data.task_id)
|
const statusRunning = !!discoveryStatus.data?.running
|
||||||
} else if (discoveryStatus.data && discoveryTaskId === discoveryStatus.data.task_id) {
|
|
||||||
|
if (statusRunning) {
|
||||||
|
// Re-attach only when drawer is closed and we don't already track the running task.
|
||||||
|
if (!discoveryOpen && !discoveryTaskId && statusTaskId) {
|
||||||
|
setDiscoveryTaskId(statusTaskId)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusTaskId && discoveryTaskId === statusTaskId) {
|
||||||
setDiscoveryTaskId(null)
|
setDiscoveryTaskId(null)
|
||||||
}
|
}
|
||||||
}, [discoveryStatus.data, discoveryTaskId, discoveryOpen])
|
}, [discoveryStatus.data, discoveryTaskId, discoveryOpen])
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue