Starts websockets on an IO Thread

This commit is contained in:
Vitor Pamplona
2023-03-10 09:35:50 -05:00
parent b9304aa1b5
commit ae1f0c5547

View File

@@ -21,6 +21,9 @@ import com.vitorpamplona.amethyst.service.relays.Client
import com.vitorpamplona.amethyst.ui.screen.AccountScreen
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
import com.vitorpamplona.amethyst.ui.theme.AmethystTheme
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
class MainActivity : FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@@ -66,7 +69,9 @@ class MainActivity : FragmentActivity() {
super.onResume()
// Only starts after login
ServiceManager.start()
GlobalScope.launch(Dispatchers.IO) {
ServiceManager.start()
}
}
override fun onPause() {