diff --git a/app/src/main/java/eu/m724/vastapp/activity/login/LoginActivity.kt b/app/src/main/java/eu/m724/vastapp/activity/login/LoginActivity.kt index 0e3055e..6695e79 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/login/LoginActivity.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/login/LoginActivity.kt @@ -60,8 +60,6 @@ import eu.m724.vastapp.activity.dashboard.DashboardActivity import eu.m724.vastapp.ui.theme.VastappTheme import eu.m724.vastapp.vastai.data.User import kotlinx.coroutines.launch -import org.chromium.net.CronetEngine -import java.util.concurrent.Executors class LoginActivity : ComponentActivity() { private lateinit var dashboardLauncher: ActivityResultLauncher @@ -73,9 +71,7 @@ class LoginActivity : ComponentActivity() { ActivityResultContracts.StartActivityForResult() ) { _ -> finish() } // TODO re-login here - val executor = Executors.newSingleThreadExecutor() - val cronetEngine = CronetEngine.Builder(baseContext).build() - val loginViewModel = LoginViewModel(application, cronetEngine, executor) + val loginViewModel = LoginViewModel(application) // load api key if saved loginViewModel.init() diff --git a/app/src/main/java/eu/m724/vastapp/activity/login/LoginViewModel.kt b/app/src/main/java/eu/m724/vastapp/activity/login/LoginViewModel.kt index 2d46fdb..f05016b 100644 --- a/app/src/main/java/eu/m724/vastapp/activity/login/LoginViewModel.kt +++ b/app/src/main/java/eu/m724/vastapp/activity/login/LoginViewModel.kt @@ -12,13 +12,9 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -import org.chromium.net.CronetEngine -import java.util.concurrent.Executor class LoginViewModel( - application: Application, - private val cronetEngine: CronetEngine, - private val executor: Executor + application: Application ) : AndroidViewModel(application) { private val _uiState: MutableStateFlow = MutableStateFlow(LoginUiState.Idle)