Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AddRemoveTagsViewModel @Inject constructor(
init {
viewModelScope.launch {
getAllTagsUseCase().onSuccess { tags ->
_state.update { it.copy(allTags = tags) }
_state.update { it.copy(allTags = tags.sortedBy { tag -> tag.lowercase() }) }
}
snapshotFlow { tagsTextState.text.toString() }
.debounce(TYPING_DEBOUNCE_TIME)
Expand Down Expand Up @@ -124,7 +124,7 @@ data class TagsViewState(
val tagsUpdated: Boolean = false,
val addedTags: Set<String> = emptySet(),
val suggestedTags: Set<String> = emptySet(),
val allTags: Set<String> = emptySet(),
val allTags: List<String> = emptyList(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to keep set here? All tag collections (added, suggested) are defined as Set, I think we should keep this for allTags as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, a Set does not preserve the order of its elements

)

sealed interface AddRemoveTagsViewModelAction {
Expand Down