Don't delay when user clicks 'Next' in special folders screen

This commit is contained in:
cketti 2023-12-19 21:30:41 +01:00
parent 6fb4bfae00
commit 674932695f
2 changed files with 8 additions and 10 deletions

View file

@ -77,7 +77,11 @@ class SpecialFoldersViewModel(
isSuccess = true,
)
}
saveSpecialFolderSettings()
delay(CONTINUE_NEXT_DELAY)
navigateNext()
}
}
}
@ -99,7 +103,7 @@ class SpecialFoldersViewModel(
}
}
private suspend fun saveSpecialFolderSettings() {
private fun saveSpecialFolderSettings() {
val formState = state.value.formState
accountStateRepository.setSpecialFolderSettings(
@ -116,15 +120,11 @@ class SpecialFoldersViewModel(
isLoading = false,
)
}
delay(CONTINUE_NEXT_DELAY)
navigateNext()
}
private fun onNextClicked() {
viewModelScope.launch {
saveSpecialFolderSettings()
}
navigateNext()
}
private fun navigateNext() {

View file

@ -197,9 +197,7 @@ class SpecialFoldersViewModelTest {
testSubject.event(Event.OnNextClicked)
turbines.assertThatAndStateTurbineConsumed {
isEqualTo(initialState.copy(isLoading = false))
}
assertThat(turbines.awaitStateItem()).isEqualTo(initialState.copy(isLoading = false))
turbines.assertThatAndEffectTurbineConsumed {
isEqualTo(Effect.NavigateNext)