diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeleteCustomListConfirmationViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeleteCustomListConfirmationViewModel.kt index 57384fc4bba3..6a1f2d286e2c 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeleteCustomListConfirmationViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeleteCustomListConfirmationViewModel.kt @@ -36,7 +36,7 @@ class DeleteCustomListConfirmationViewModel( fun deleteCustomList() { viewModelScope.launch { - _error.tryEmit(null) + _error.emit(null) customListActionUseCase .performAction(CustomListAction.Delete(customListId)) .fold( diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt index df24421f0bb1..34c419808391 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/DeviceListViewModel.kt @@ -48,7 +48,7 @@ class DeviceListViewModel( } } .onStart { fetchDevices() } - .stateIn(viewModelScope, SharingStarted.Lazily, DeviceListUiState.Loading) + .stateIn(viewModelScope, SharingStarted.WhileSubscribed(), DeviceListUiState.Loading) fun fetchDevices() = viewModelScope.launch { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt index c1a74377fd65..8fc0ce872504 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SplashViewModel.kt @@ -57,8 +57,8 @@ class SplashViewModel( } return if (accountData != null && accountData.expiryDate.isBeforeNow) { - SplashUiSideEffect.NavigateToOutOfTime - } else { + SplashUiSideEffect.NavigateToOutOfTime + } else { SplashUiSideEffect.NavigateToConnect } } diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/AccountViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/AccountViewModelTest.kt index 8659925ade87..32d6f5d1afe6 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/AccountViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/AccountViewModelTest.kt @@ -34,8 +34,7 @@ import org.junit.jupiter.api.extension.ExtendWith @ExtendWith(TestCoroutineRule::class) class AccountViewModelTest { - private val mockAccountRepository: AccountRepository = - mockk(relaxUnitFun = true) + private val mockAccountRepository: AccountRepository = mockk(relaxUnitFun = true) private val mockPaymentUseCase: PaymentUseCase = mockk(relaxed = true) private val accountState: MutableStateFlow = MutableStateFlow(null) diff --git a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/OutOfTimeViewModelTest.kt b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/OutOfTimeViewModelTest.kt index 83c030201715..3e5d2ba620d4 100644 --- a/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/OutOfTimeViewModelTest.kt +++ b/android/app/src/test/kotlin/net/mullvad/mullvadvpn/viewmodel/OutOfTimeViewModelTest.kt @@ -2,11 +2,9 @@ package net.mullvad.mullvadvpn.viewmodel import androidx.lifecycle.viewModelScope import app.cash.turbine.test -import io.mockk.Runs import io.mockk.coEvery import io.mockk.coVerify import io.mockk.every -import io.mockk.just import io.mockk.mockk import io.mockk.mockkStatic import io.mockk.unmockkAll diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt index 993eb5fa9da3..144d84595006 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt @@ -565,20 +565,3 @@ sealed interface GrpcConnectivityState { data object Shutdown : GrpcConnectivityState } - -sealed interface ServiceConnectionState { - data class Connected(val serviceState: ServiceState) : ServiceConnectionState - - data class Connecting(val lastKnownState: ServiceState?) : ServiceConnectionState - - data class Disconnected(val lastKnownState: ServiceState?, val error: ServiceConnectError?) : - ServiceConnectionState -} - -data class ServiceState(val settings: ModelSettings, val accountState: ModelSettings) - -sealed interface ServiceConnectError { - data object Timeout : ServiceConnectError - - data class Connection(val message: String) : ServiceConnectError -}