1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-30 14:08:44 +00:00

Update BehaviourContextWithFSM.kt

This commit is contained in:
InsanusMokrassar 2022-12-28 22:59:10 +06:00 committed by GitHub
parent ee055873e6
commit c193b512d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,7 +197,7 @@ class DefaultBehaviourContextWithFSM<T : State>(
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)