Updated on 2026-08-14
This commit is contained in:
parent
aac48015b3
commit
4aa267c951
1 changed files with 7 additions and 9 deletions
|
|
@ -127,19 +127,17 @@ internal class NewsListModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun onCategoryClick(categoryId: Int) {
|
||||
val newCategoryId = if (state.value.selectedCategoryId == categoryId) {
|
||||
DEFAULT_ALL_NEWS_CATEGORIES_ID
|
||||
} else {
|
||||
categoryId
|
||||
if (state.value.selectedCategoryId == categoryId) {
|
||||
return
|
||||
}
|
||||
if (newCategoryId != DEFAULT_ALL_NEWS_CATEGORIES_ID) {
|
||||
analyticsEventHandler.send(NewsListAnalyticsEvent.NewsCategoriesClick(newCategoryId))
|
||||
if (categoryId != DEFAULT_ALL_NEWS_CATEGORIES_ID) {
|
||||
analyticsEventHandler.send(NewsListAnalyticsEvent.NewsCategoriesClick(categoryId))
|
||||
}
|
||||
selectedCategoryId.value = newCategoryId
|
||||
selectedCategoryId.value = categoryId
|
||||
_state.update { currentState ->
|
||||
currentState.copy(
|
||||
selectedCategoryId = newCategoryId,
|
||||
filters = updateFilterChips(newCategoryId),
|
||||
selectedCategoryId = categoryId,
|
||||
filters = updateFilterChips(categoryId),
|
||||
)
|
||||
}
|
||||
batchFlowManager.reload()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue