mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
Update BehaviourContextWithFSM.kt
This commit is contained in:
parent
692b668f92
commit
dbe2607994
@ -197,7 +197,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
|
|||||||
statesJobsMutex.withLock {
|
statesJobsMutex.withLock {
|
||||||
runCatchingSafely { statesJobs.remove(old) ?.cancel() }
|
runCatchingSafely { statesJobs.remove(old) ?.cancel() }
|
||||||
runCatchingSafely { statesJobs.remove(new) ?.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) {
|
if (old.context != new.context) {
|
||||||
updatesFlows.remove(old.context)
|
updatesFlows.remove(old.context)
|
||||||
|
Loading…
Reference in New Issue
Block a user