Skip to content

Commit

Permalink
Refactor CollapsedTrnListDatesFlow.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Jan 4, 2023
1 parent 82bf185 commit f8d304c
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import javax.inject.Singleton
private val collapsedTrnListDates = MutableStateFlow(emptySet<String>())

fun toggleTrnListDate(dateId: String) {
collapsedTrnListDates.value = collapsedTrnListDates.value.toMutableSet().apply {
if (dateId in this) {
remove(dateId)
} else {
add(dateId)
collapsedTrnListDates.value = collapsedTrnListDates.value
.toMutableSet()
.apply {
if (dateId in this) {
remove(dateId)
} else {
add(dateId)
}
}
}
}

@Singleton
Expand Down

0 comments on commit f8d304c

Please sign in to comment.