mirror of
https://github.com/bitwarden/android.git
synced 2025-01-30 19:53:47 +03:00
[PM-16670] Force vault to sync by remove last sync date
This commit is contained in:
parent
b958734946
commit
5c06d04a6f
2 changed files with 7 additions and 0 deletions
app/src
main/java/com/x8bit/bitwarden/ui/auth/feature/newdevicenotice
test/java/com/x8bit/bitwarden/ui/auth/feature/newdevicenotice
|
@ -8,6 +8,7 @@ import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
|||
import com.x8bit.bitwarden.data.platform.manager.FeatureFlagManager
|
||||
import com.x8bit.bitwarden.data.platform.manager.model.FlagKey
|
||||
import com.x8bit.bitwarden.data.platform.repository.EnvironmentRepository
|
||||
import com.x8bit.bitwarden.data.platform.repository.SettingsRepository
|
||||
import com.x8bit.bitwarden.data.platform.repository.util.baseWebVaultUrlOrDefault
|
||||
import com.x8bit.bitwarden.ui.auth.feature.newdevicenotice.NewDeviceNoticeTwoFactorAction.ChangeAccountEmailClick
|
||||
import com.x8bit.bitwarden.ui.auth.feature.newdevicenotice.NewDeviceNoticeTwoFactorAction.ContinueDialogClick
|
||||
|
@ -32,6 +33,7 @@ class NewDeviceNoticeTwoFactorViewModel @Inject constructor(
|
|||
val authRepository: AuthRepository,
|
||||
val environmentRepository: EnvironmentRepository,
|
||||
val featureFlagManager: FeatureFlagManager,
|
||||
val settingsRepository: SettingsRepository,
|
||||
) : BaseViewModel<
|
||||
NewDeviceNoticeTwoFactorState,
|
||||
NewDeviceNoticeTwoFactorEvent,
|
||||
|
@ -88,6 +90,8 @@ class NewDeviceNoticeTwoFactorViewModel @Inject constructor(
|
|||
private fun handleContinueDialog() {
|
||||
when (state.dialogState) {
|
||||
is ChangeAccountEmailDialog -> {
|
||||
// when the user leaves the app set sync date to null to force a sync on next unlock
|
||||
settingsRepository.vaultLastSync = null
|
||||
sendEvent(
|
||||
NewDeviceNoticeTwoFactorEvent.NavigateToChangeAccountEmail(url = webAccountUrl),
|
||||
)
|
||||
|
@ -95,6 +99,8 @@ class NewDeviceNoticeTwoFactorViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
is TurnOnTwoFactorDialog -> {
|
||||
// when the user leaves the app set sync date to null to force a sync on next unlock
|
||||
settingsRepository.vaultLastSync = null
|
||||
sendEvent(
|
||||
NewDeviceNoticeTwoFactorEvent.NavigateToTurnOnTwoFactor(url = webTwoFactorUrl),
|
||||
)
|
||||
|
|
|
@ -172,6 +172,7 @@ class NewDeviceNoticeTwoFactorViewModelTest : BaseViewModelTest() {
|
|||
authRepository = authRepository,
|
||||
environmentRepository = environmentRepository,
|
||||
featureFlagManager = featureFlagManager,
|
||||
settingsRepository = mockk(relaxed = true),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue