Skip to content

Commit

Permalink
temporary fix client init
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Sep 28, 2023
1 parent 8907111 commit a915107
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/src/main/java/io/github/a13e300/ro_tieba/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ import io.github.a13e300.ro_tieba.api.TiebaClient
import io.github.a13e300.ro_tieba.datastore.Settings
import io.github.a13e300.ro_tieba.db.AppDataBase
import io.github.a13e300.ro_tieba.utils.ignoreAllSSLErrorsIfDebug
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import okhttp3.OkHttpClient

class App : Application(), SketchFactory {
companion object {
lateinit var instance: App
private set
val gson = Gson()
val appScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
}

lateinit var db: AppDataBase
Expand All @@ -44,7 +40,7 @@ class App : Application(), SketchFactory {
super.onCreate()
instance = this
db = Room.databaseBuilder(this, AppDataBase::class.java, "app-db").build()
appScope.launch {
runBlocking {
accountManager.initAccount()
}
}
Expand Down

0 comments on commit a915107

Please sign in to comment.