Create coroutine application scope

This commit is contained in:
ganfra 2022-11-10 16:28:06 +01:00
parent 0719dc53f2
commit 21228c23b2
2 changed files with 9 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package io.element.android.x.matrix
import android.annotation.SuppressLint
import android.content.Context
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
@ -9,8 +10,8 @@ object MatrixInstance {
@SuppressLint("StaticFieldLeak")
private lateinit var instance: Matrix
fun init(context: Context) {
instance = Matrix(GlobalScope, context)
fun init(context: Context, coroutineScope: CoroutineScope) {
instance = Matrix(coroutineScope, context)
}
fun getInstance(): Matrix {