mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-21 20:41:56 +02:00
Starts websockets on an IO Thread
This commit is contained in:
@@ -21,6 +21,9 @@ import com.vitorpamplona.amethyst.service.relays.Client
|
|||||||
import com.vitorpamplona.amethyst.ui.screen.AccountScreen
|
import com.vitorpamplona.amethyst.ui.screen.AccountScreen
|
||||||
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
|
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.theme.AmethystTheme
|
import com.vitorpamplona.amethyst.ui.theme.AmethystTheme
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.GlobalScope
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class MainActivity : FragmentActivity() {
|
class MainActivity : FragmentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@@ -66,7 +69,9 @@ class MainActivity : FragmentActivity() {
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
// Only starts after login
|
// Only starts after login
|
||||||
ServiceManager.start()
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
|
ServiceManager.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
|
Reference in New Issue
Block a user