we no longer need that

This commit is contained in:
Minecon724 2024-08-08 12:06:30 +02:00
parent b0d86f0a67
commit 3e1631908a
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8
2 changed files with 2 additions and 10 deletions

View file

@ -60,8 +60,6 @@ import eu.m724.vastapp.activity.dashboard.DashboardActivity
import eu.m724.vastapp.ui.theme.VastappTheme import eu.m724.vastapp.ui.theme.VastappTheme
import eu.m724.vastapp.vastai.data.User import eu.m724.vastapp.vastai.data.User
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.chromium.net.CronetEngine
import java.util.concurrent.Executors
class LoginActivity : ComponentActivity() { class LoginActivity : ComponentActivity() {
private lateinit var dashboardLauncher: ActivityResultLauncher<Intent> private lateinit var dashboardLauncher: ActivityResultLauncher<Intent>
@ -73,9 +71,7 @@ class LoginActivity : ComponentActivity() {
ActivityResultContracts.StartActivityForResult() ActivityResultContracts.StartActivityForResult()
) { _ -> finish() } // TODO re-login here ) { _ -> finish() } // TODO re-login here
val executor = Executors.newSingleThreadExecutor() val loginViewModel = LoginViewModel(application)
val cronetEngine = CronetEngine.Builder(baseContext).build()
val loginViewModel = LoginViewModel(application, cronetEngine, executor)
// load api key if saved // load api key if saved
loginViewModel.init() loginViewModel.init()

View file

@ -12,13 +12,9 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.chromium.net.CronetEngine
import java.util.concurrent.Executor
class LoginViewModel( class LoginViewModel(
application: Application, application: Application
private val cronetEngine: CronetEngine,
private val executor: Executor
) : AndroidViewModel(application) { ) : AndroidViewModel(application) {
private val _uiState: MutableStateFlow<LoginUiState> = private val _uiState: MutableStateFlow<LoginUiState> =
MutableStateFlow(LoginUiState.Idle) MutableStateFlow(LoginUiState.Idle)