ммммм
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
|
||||
|
||||
useEffect(() => {
|
||||
if (discoveryStatus.data?.running && !discoveryOpen) {
|
||||
setDiscoveryTaskId(discoveryStatus.data.task_id)
|
||||
} else if (discoveryStatus.data && discoveryTaskId === discoveryStatus.data.task_id) {
|
||||
const statusTaskId = discoveryStatus.data?.task_id
|
||||
const statusRunning = !!discoveryStatus.data?.running
|
||||
|
||||
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)
|
||||
}
|
||||
}, [discoveryStatus.data, discoveryTaskId, discoveryOpen])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue