From c193b512d96c84b72444b036d37605eccc531b85 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)