fix: Honour the FAB_HIDE preference in timelines (#227)

This commit is contained in:
Nik Clayton 2023-11-06 16:29:46 +01:00 committed by GitHub
parent c2292a565e
commit 392eb55485
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -381,12 +381,12 @@ abstract class TimelineViewModel(
.filter { it == PrefKeys.FAB_HIDE }
.map {
UiState(
sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false),
showFabWhileScrolling = !sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false),
)
}.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(stopTimeoutMillis = 5000),
initialValue = UiState(showFabWhileScrolling = true),
initialValue = UiState(showFabWhileScrolling = !sharedPreferencesRepository.getBoolean(PrefKeys.FAB_HIDE, false)),
)
if (timelineKind is TimelineKind.Home) {

View File

@ -52,7 +52,7 @@ class CachedTimelineViewModelTestUiState : CachedTimelineViewModelTestBase() {
// Given
sharedPreferencesRepository.edit {
putBoolean(PrefKeys.FAB_HIDE, false)
putBoolean(PrefKeys.FAB_HIDE, true)
}
// Then

View File

@ -52,7 +52,7 @@ class NetworkTimelineViewModelTestUiState : NetworkTimelineViewModelTestBase() {
// When
sharedPreferencesRepository.edit {
putBoolean(PrefKeys.FAB_HIDE, false)
putBoolean(PrefKeys.FAB_HIDE, true)
}
// Then