From dbe2607994014b895a40e164ef933f406d9ae291 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 28 Dec 2022 22:59:10 +0600 Subject: [PATCH] Update BehaviourContextWithFSM.kt --- .../extensions/behaviour_builder/BehaviourContextWithFSM.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgbotapi.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM.kt b/tgbotapi.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM.kt index cbec86bf52..cf9850f52b 100644 --- a/tgbotapi.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM.kt +++ b/tgbotapi.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSM.kt @@ -197,7 +197,7 @@ class DefaultBehaviourContextWithFSM( statesJobsMutex.withLock { runCatchingSafely { statesJobs.remove(old) ?.cancel() } runCatchingSafely { statesJobs.remove(new) ?.cancel() } - statesJobs[new] = launch { statePerformer(new) }.apply { enableRemoveOnCompletion(it) } + statesJobs[new] = launch { statePerformer(new) }.apply { enableRemoveOnCompletion(new) } } if (old.context != new.context) { updatesFlows.remove(old.context)