ненавижу вайбкодеров
This commit is contained in:
parent
b3ea9d84cb
commit
7200b4cd62
1 changed files with 3 additions and 4 deletions
|
|
@ -175,21 +175,20 @@ export function ObjectDetailPage({ defaultMode = 'inventory' }: { defaultMode?:
|
|||
const [editRackForm] = Form.useForm()
|
||||
|
||||
const currentAction = actions?.find((a) => a.name === selectedAction)
|
||||
const discoveryRunning = discoverMutation.isPending || !!discoveryTaskId || !!discoveryStatus.data?.running
|
||||
const discoveryRunning = discoverMutation.isPending || !!discoveryStatus.data?.running
|
||||
|
||||
useEffect(() => {
|
||||
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) {
|
||||
if (statusTaskId && discoveryTaskId !== statusTaskId) {
|
||||
setDiscoveryTaskId(statusTaskId)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (statusTaskId && discoveryTaskId === statusTaskId) {
|
||||
if (!discoveryOpen && statusTaskId && discoveryTaskId === statusTaskId) {
|
||||
setDiscoveryTaskId(null)
|
||||
}
|
||||
}, [discoveryStatus.data, discoveryTaskId, discoveryOpen])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue