Skip to content

Commit

Permalink
Fix featured section position getting reset after bookmarking a post
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Oct 18, 2023
1 parent df95a54 commit 3fa8352
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
Expand Down Expand Up @@ -219,8 +220,9 @@ class HomePresenter(
_state.update {
it.copy(selectedFeed = selectedFeed, posts = posts, featuredPosts = featuredPosts)
}
effects.tryEmit(HomeEffect.ScrollToTop)
}
.distinctUntilChangedBy { (selectedFeed, _, _) -> selectedFeed }
.onEach { effects.tryEmit(HomeEffect.ScrollToTop) }
.launchIn(coroutineScope)

settingsRepository.enableFeaturedItemBlur
Expand Down

0 comments on commit 3fa8352

Please sign in to comment.