mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-17 19:58:57 +03:00
Remove usage of GlobalScope
This commit is contained in:
parent
1e708b113b
commit
0437814479
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,7 @@ import dagger.assisted.AssistedInject
|
|||
import dagger.assisted.AssistedFactory
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.resources.StringProvider
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import im.vector.app.features.session.coroutineScope
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.query.QueryStringValue
|
||||
|
@ -465,7 +465,8 @@ class WidgetPostAPIHandler @AssistedInject constructor(@Assisted private val roo
|
|||
}
|
||||
|
||||
private fun launchWidgetAPIAction(widgetPostAPIMediator: WidgetPostAPIMediator, eventData: JsonDict, block: suspend () -> Unit): Job {
|
||||
return GlobalScope.launch {
|
||||
// We should probably use a scope tight to the lifecycle here...
|
||||
return session.coroutineScope.launch {
|
||||
kotlin.runCatching {
|
||||
block()
|
||||
}.fold(
|
||||
|
|
Loading…
Add table
Reference in a new issue