From bd91429676abc79a5c8130bc1375b34738a0bf92 Mon Sep 17 00:00:00 2001 From: Mikhail Shatikhin Date: Thu, 12 Dec 2024 16:44:35 +0500 Subject: [PATCH] fix: order of async operations --- packages/react-ui/lib/taskWithDelayAndMinimalDuration.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-ui/lib/taskWithDelayAndMinimalDuration.ts b/packages/react-ui/lib/taskWithDelayAndMinimalDuration.ts index be6b5990488..d633ab2989f 100644 --- a/packages/react-ui/lib/taskWithDelayAndMinimalDuration.ts +++ b/packages/react-ui/lib/taskWithDelayAndMinimalDuration.ts @@ -67,13 +67,13 @@ export class TaskWithDelayAndMinimalDuration { this.isTaskActive = false; - if (!this.timeoutBeforeTaskStart && !this.timeoutBeforeTaskStop) { - this.taskParams.taskStopCallback(); - } - if (this.timeoutBeforeTaskStart) { this.clearTimeoutBeforeTaskStart(); } + + if (!this.timeoutBeforeTaskStart && !this.timeoutBeforeTaskStop) { + this.taskParams.taskStopCallback(); + } }; public clearTask = () => {