You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/feature_records_filter/src/main/java/com/example/util/simpletimetracker/feature_records_filter/interactor/RecordsFilterUpdateInteractor.kt
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -515,11 +515,12 @@ class RecordsFilterUpdateInteractor @Inject constructor(
515
515
typesToTags:List<RecordTypeToTag>,
516
516
): List<RecordsFilter> {
517
517
val filters = currentFilters.toMutableList()
518
-
// Update tags according to selected activities
519
-
val newTypeIds:List<Long> = filters.getAllTypeIds(
520
-
recordTypes = recordTypes,
521
-
recordTypeCategories = recordTypeCategories,
522
-
)
518
+
// Update tags according to selected activities.
519
+
// If no activities selected - show all tags.
520
+
val newTypeIds:List<Long> = filters
521
+
.getAllTypeIds(recordTypes, recordTypeCategories)
522
+
.takeUnless { it.isEmpty() }
523
+
?: recordTypes.map(RecordType::id)
523
524
val tagIds = recordTags.map(RecordTag::id)
524
525
val selectableTagIds = filterSelectableTagsInteractor.execute(
0 commit comments