Update feedItemsSize calculation

Change-Id: I2bf6a2fa0e210cef1318707d948a49d2ef010452
pull/877/head
dahunsi 1 year ago
parent 9babb50c58
commit 03610d229a

@ -489,17 +489,16 @@ private fun feedItemsSize(
onboardingUiState: OnboardingUiState, onboardingUiState: OnboardingUiState,
): Int { ): Int {
val feedSize = when (feedState) { val feedSize = when (feedState) {
NewsFeedUiState.Loading -> 1 NewsFeedUiState.Loading -> 0
is NewsFeedUiState.Success -> feedState.feed.size is NewsFeedUiState.Success -> feedState.feed.size
} }
val onboardingSize = when (onboardingUiState) { val onboardingSize = when (onboardingUiState) {
OnboardingUiState.Loading,
OnboardingUiState.LoadFailed, OnboardingUiState.LoadFailed,
OnboardingUiState.NotShown, OnboardingUiState.NotShown,
-> 0 -> 0
OnboardingUiState.Loading, is OnboardingUiState.Shown -> 1
is OnboardingUiState.Shown,
-> 1
} }
return feedSize + onboardingSize return feedSize + onboardingSize
} }

Loading…
Cancel
Save